n = int(input()) A = list(map(int, input().split())) cnt = 0 for i in range(n): if abs(A[i]) % 2 == 0: cnt += 1 else: cnt -= 1 print(abs(cnt))