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