n = int(input()) x = list(map(int, input().split())) odd = 0 for i in x: if i % 2: odd += 1 print(abs(n - 2 * odd))