#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int nz[n];
    for (int i = 0;i < n;i++)
    {
        cin>>nz[i];
    }
    sort (nz, nz + n);
    int brc, brn;
    for (int j = 0;j < n; j++)
    {
        if (nz[j] =! j + 1)
        {
            if (nz[j] % 2 == 0)brc = brc + 1;
             else brn = brn + 1;
        }
    }
    cout<<brn - 2<<" "<<brc + 1;
    return 0;
}