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