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