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