N = int(input()) L = list(map(int, input().split())) A = len([a for a in L if a % 2 == 0]) print(abs(N - 2*A))