#include<iostream>
using namespace std;

int main() {
    int n;
    int arr[n];
    cin >> n;
    int br_chet = 0;
    int br_nechet = 0;
    int maxc;
    int maxn;

    for (int i = 0; i < n; i++) {
        cin >> arr[i];
        while (arr[i] % 2 = 1) {
            br_nechet++;
            maxn = arr[i];
        }
        while (arr[i] % 2 = 0) {
            br_chet++;
            maxc = arr[i];
        }
    }
    int chet = (maxc - 2) / 2 + 1;
    int nechet = (maxn - 1) / 2 + 1;
    cout << nechet - br_nechet << " " << chet - br_chet;
    return 0;
}