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

int n;
int br = 0, chislo;
int even, odd;
int lchislo;
int lodd, leven;

cin>>n;

while(br<n){
    cin>>chislo;
    br++;
    if(chislo%2==1){
        odd++;
    }else{
        even++;
    }

    if(chislo%2 == 0 && lchislo%2 == 1){
        lodd == lchislo;
    }
    if(br == n - 1){
        leven == chislo;
    }
    lchislo = chislo;
}

cout<<lodd - odd<<' '<<leven - even;


    return 0;
}
