N = int(input()) X = list(map(int, input().split())) print(abs(sum(1 if x % 2 else -1 for x in X)))