N = int(input()) X = map(int, input().split()) s = 0 for i in X: s += (i % 2) * 2 - 1 print(abs(s))