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