input() X=list(map(int,input().split())) Y=[] for x in X: x%=2 if x>0: while x>1:x-=2 else: while x<0:x+=2 Y.append(x) #print(X) #print(Y) print(abs(Y.count(0)-Y.count(1)))