#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int n;
cin>>n;
int k[n];
for(int i=0;i<n;i++)cin>>k[i];
sort(k,k+n);
bool odd=false,even=false;
int oM=0,eM=0;
for(int i=n-1;i>=0;i--){
    if(k[i]%2==0&&even==false){
        eM=k[i];
        even=true;
    }
    else if(k[i]%2==1&&odd==false){
        oM=k[i];
        odd=true;
    }
    if(odd&&even)break;
}
int have_odd=oM/2+1,have_even=eM/2;

for(int i=0;i<n;i++){
    if(k[i]%2==0){
        have_even--;
    }
    else{
        have_odd--;
    }
}
cout<<have_odd<<" "<<have_even;
return 0;
}
