N=int(input()) X=[int(i) for i in input().split()] Eo=0 for i in range (N): if X[i]%2==0: Eo+=1 else: Eo-=1 if Eo<0: Eo*=-1 print (Eo)