#include<iostream>
using namespace std;
int main()
{
    long long n;
    long long chisla;
    long long br_ch = 0;
    long long br_nech = 0;
    long long ch_zad = 0;
    long long nech_zad = 0;
    long long max_nech = 0;
    long long max_ch = 0;
    long long br = 0;

    cin>>n;
    while(br < n)
    {
        br++;
        cin>>chisla;
        if(chisla % 2 > 0)
        {
            br_nech++;
            if(chisla > max_nech)
            {
                max_nech = chisla;
            }
        }
        else
        {
            br_ch++;
            if(chisla > max_ch)
            {
                max_ch = chisla;
            }
        }
    }

    if(br_nech < max_nech/2 + 1)
    {
        nech_zad = ((max_nech/2) + 1) - br_nech;
    }
    else
    {
        nech_zad = 0;
    }

    if(br_ch < max_ch/2)
    {
        ch_zad = (max_ch/2) - br_ch;
    }
    else
    {
        ch_zad = 0;
    }

    cout<<nech_zad<<" "<<ch_zad;
    return 0;
}
