#include<bits/stdc++.h>
using namespace std;
int main(){
long long n,a=0,max_nechetno=0,max_chetno=0,nechetno=0,chetno=0;
cin>>n;
while(a<=n){
cin>>a;
if(a%2==0){
chetno++;
if(a>=max_chetno){
max_chetno=a;
}
}else{
if(a%2==1){
nechetno++;
if(a>=max_nechetno){
max_nechetno=a;
}
}
}
a++;
}
cout<<(max_nechetno-1)/2+1-nechetno<<" "<<(max_chetno-2)/2+1-chetno+2<<endl;
return 0;
}