#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n, a, maxi_nechetno=0, maxi_chetno=0, sum=0, sum1=0;
    cin>>n;
    for(long long i=1; i<=n; i++)
    {
        cin>>a;
        if(a%2==1 && a>=maxi_nechetno)
        {
            maxi_nechetno=a;
            sum=sum+1;
        }
        if(a%2==0 && a>=maxi_chetno)
        {
            maxi_chetno=a;
            sum1=sum1+1;
        }
    }
    cout<<(maxi_nechetno-(sum*2))/2+1<<" ";
    cout<<(maxi_chetno-(sum1*2))/2;




    return 0;
}
