N = int(input()) X = map(int, input().split()) C = 0 for i in X: if i % 2 == 0: C += 1 elif i == 0: C += 1 else: C -= 1 print(abs(C))