I=input I() x=list(map(int,I().split())) print(abs(len(x)-len([y for y in x if y&1])*2))