#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long tt = 1;
  while (tt--) {
    long long n;
    cin >> n;
    long long i;
    vector<long long> a(n);
    for (i = 0; i < n; i++) cin >> a[i];
    sort(a.begin(), a.end());
    set<long long> mx, mn;
    for (auto x : a) {
      if (mx.find(x - 1) == mx.end())
        mx.insert(x - 1);
      else if (mx.find(x) == mx.end())
        mx.insert(x);
      else if (mx.find(x + 1) == mx.end())
        mx.insert(x + 1);
      if (mn.find(x + 1) != mn.end()) {
      } else if (mn.find(x) != mn.end()) {
      } else if (mn.find(x - 1) != mn.end()) {
      } else
        mn.insert(x + 1);
    }
    cout << mn.size() << " " << mx.size();
  }
  return 0;
}
