#include<bits/stdc++.h>

using namespace std;

int niz[500000];

int main()
{
    int n;
    cin >> n;
    int p=0,np=0;
    bool isti = true;
    for(int i = 0;i < n;i++)
    {
        int a;
        cin >> a;
        if(i != 0 && niz[i-1]!=a)
            isti = false;
        if(a % 2 == 0)
            p++;
        else
            np++;
    }
    //cout << p << " " << np << endl;
    if(isti)
        cout << 1;
    if(p > np)
        cout << np;
    else
        cout << p;
}