#include <iostream>
using namespace std;
int main()
{
    int n,m[n],brc=0,brnc=0,segchis=1,k=0;
    cin >> n ;
    for (int i=0;i<n-1;i=i+1){
        cin >> m[i];
    }
    while (m[k]%2==1)
    {
        if (segchis!=m[k])
        {
            brnc=brnc+1;
        }
        segchis=segchis+2;
        k=k+1;
    }
    cout<< brnc << " ";
    segchis=2;
    while (k<n)
    {
        if ((segchis!=m[k])&&(m[k]%2==0))
        {
            brc=brc+1;
            n=n-1;
        }
        k=k+1;
        segchis=segchis+2;
    }
    cout <<  brc;
    return 0;
}