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