from typing import List


class Solution:
    # greedy
    def minCostToMoveChips(self, position: List[int]) -> int:
        even_cnt = 0
        odd_cnt = 0
        for i in position:
            if i % 2 == 0:
                even_cnt += 1
            else:
                odd_cnt += 1
        return min(even_cnt, odd_cnt)


if __name__ == "__main__":
    solution = Solution()
    position = [1, 2, 3]
    result = solution.minCostToMoveChips(position)
    print(result)
    position = [2, 2, 2, 3, 3]
    result = solution.minCostToMoveChips(position)
    print(result)
