#include using namespace std; int main(){ int N; int a=0,b=0; scanf("%d",&N); while(N--){ int x; scanf("%d",&x); if(x&1)a++; else b++; } printf("%d\n",abs(a-b)); return 0; }