n = int(input()) x = list(map(int, input().split())) even = 0 odd = 0 for num in x: if num % 2 == 0: even += 1 else: odd += 1 pairs = min(even, odd) remain_even = even - pairs remain_odd = odd - pairs answer = (remain_even % 2) + (remain_odd % 2) print(answer)