s,a;main(n){for(gets(&a);~scanf("%d",&a);s+=a%2*2-1);s=!printf("%d",s>0?s:-s);}