#include <bits/stdc++.h>
using namespace std;
map<int, int> vis1;
map<int, int> vis2;
set<int> s1;
set<int> s2;
int main() {
  int n;
  cin >> n;
  int a[n + 5];
  int b[n + 5];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(a, a + n);
  sort(b, b + n);
  for (int i = 0; i < n; i++) {
    int x = a[i];
    if (vis1[x - 1] == 0) {
      --a[i];
      vis1[a[i]] = 1;
    } else if (vis1[x] == 0) {
      vis1[x] = 1;
    } else if (vis1[x + 1] == 0) {
      ++a[i];
      vis1[a[i]] = 1;
    }
  }
  for (int i = 0; i < n; i++) s1.insert(a[i]);
  for (int i = 0; i < n; i++) {
    if (vis2[b[i] - 1] == 1) {
      --b[i];
    } else if (vis2[b[i] + 1] == 1)
      ++b[i];
    else if (vis2[b[i]] == 0) {
      ++b[i];
      vis2[b[i]] = 1;
    }
  }
  for (int i = 0; i < n; i++) s2.insert(b[i]);
  cout << s2.size() << " " << s1.size() << endl;
}
