#coding: utf-8 ##yuki_99 n=int(raw_input()) x=map(int,raw_input().split()) even=0 for i in xrange(n): if x[i]%2==0: even+=1 odd=len(x)-even print abs(odd-even)