#include <bits/stdc++.h>
long long mod = 1000000007;
using namespace std;
using namespace std;
int main() {
  long long i, j, k, l, m, n;
  cin >> n;
  vector<long long> a(n + 1);
  vector<long long> b(n + 1);
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  b = a;
  long long mn = 0, mx = 0;
  sort(a.begin(), a.end());
  long long pre = a[1] + 1;
  a[1] = a[1] + 1;
  for (i = 2; i <= n; i++) {
    if (a[i] == pre) {
      continue;
    }
    if (a[i] - 1 == pre) {
      a[i] = a[i] - 1;
      continue;
    }
    a[i] = a[i] + 1;
    pre = a[i];
  }
  set<long long> s1;
  for (i = 1; i <= n; i++) {
    s1.insert(a[i]);
  }
  cout << s1.size() << " ";
  sort(b.begin(), b.end());
  pre = b[1] - 1;
  b[1] = b[1] - 1;
  for (i = 2; i <= n; i++) {
    if (pre == b[i]) {
      b[i] = b[i] + 1;
      pre = b[i];
      continue;
    }
    if (pre > b[i]) {
      continue;
    }
    if (pre == b[i] - 1) {
      pre = b[i];
      continue;
    }
    if (pre < b[i] - 1) {
      b[i] = b[i] - 1;
      pre = b[i];
      continue;
    }
  }
  set<long long> s2;
  for (i = 1; i <= n; i++) {
    s2.insert(b[i]);
  }
  cout << s2.size();
}
