#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n;
    cin>>n;
    long long nomera[n],chetni = 0, nechetni = 0;
    for(long long broq=0;broq<n;broq++)
    {
        cin>>nomera[broq];
    }
    for(long long broq=0;broq<n;broq++)
    {
        if(nomera[broq]%2==0)
        {
            chetni++;
        }
        else
        {
            nechetni++;
        }
    }
    cout<<(nomera[nechetni-1]+1)/2 - nechetni<<" ";
    cout<<nomera[chetni+nechetni-1]/2 - chetni;
    return 0;
}