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