#include<iostream>
using namespace std;

int main(  )
{
    int net = -1,chet = 0,num = 0,d,br = 0, br2 = 0;
    cin >> num;
    for(int i = 0; i < num; i++)
    {
        cin >> d;
        if(d % 2 == 0 && d > chet)
        {
            chet = d;
            br++;
        }
        if(d % 2 == 1 && d > net)
        {
            br2++;
            net = d;
        }
    }
    cout << net/2 + 1 - br2 << " " <<chet/2 - br;
    cout << endl;
    return 0;
}
