N = int(input()) Xs = list(map(int, input().split())) diff = 0 for x in Xs: if x % 2: diff += 1 else: diff -= 1 print(abs(diff))