#coding:utf-8 N=input() X=map(int,raw_input().split()) X.sort() cnt=0 for i in range(N): if X[i]%2==0: cnt+=1 else: cnt-=1 print abs(cnt)