#include<iostream>
using namespace std;
int main(){

int n;
int chislo, br = 0;
int nl, nr;
int lr, ll;

cin>>n;

while(br<n){
    cin>>chislo;
    if(chislo%2==0){
        nr++;
    }else{
        nl++;
    }
    br++;
    if(br == n-1){
        lr = chislo;
    }if(br == n-2){
        ll = chislo;
    }
}

cout<<ll - nl<<' '<<lr - nr;


    return 0;
}
