#include <iostream>
using namespace std;

int main()
{
    int n,ch=0,nch=0,zch=0,znch=0;
    cin >> n;
    int num[n];

    for (int i=0; i<n; i++)
    {
        cin >> num[i];
        if (num[i]%2==0)
        {
            ch=i;
        }
        else
        {
            nch=nch+1;
        }
    }

    for (int i=0; i<nch; i++)
    {
        if (num[i+1]-num[i]>2)
        {
          znch=znch+(num[i+1]-num[i])/2-1;
        }
    }

    if (num[0]-1>2)
    {
        znch=znch+(num[0]-1)/2;
    }

    for (int i=ch; i<n-1; i++)
    {
            zch=zch+(num[i+1]-num[i])/2;
    }


    if (num[ch]-2>2)
    {
        zch=zch+(num[0]-2)/2+1;
    }


    cout << znch << " " << zch;

    return 0;
}
