#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  if (true) {
    vector<bool> db(1 + n + 1 + 5, false);
    for (int i = 0; i < n; ++i) {
      int x = v[i];
      if ((!db[x - 1]) && ((!db[x]) && (!db[x + 1]))) {
        db[x + 1] = true;
      }
    }
    int ans = 0;
    for (int i = 0; i <= n + 1; ++i) {
      if (db[i]) ++ans;
    }
    cout << ans << " ";
  }
  vector<bool> db(n + 5, false);
  for (int i = 0; i < n; ++i) {
    int x = v[i];
    if (!db[x - 1]) {
      db[x - 1] = true;
    } else if (!db[x]) {
      db[x] = true;
    } else if (!db[x + 1]) {
      db[x + 1] = true;
    }
  }
  int ans = 0;
  for (int i = 0; i <= n + 1; ++i) {
    if (db[i]) ++ans;
  }
  cout << ans << "\n";
  return 0;
}
