#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  set<int> mn, mx;
  for (int i = 0; i < n; i++) cin >> v[i];
  sort(v.begin(), v.end());
  for (int i = 0; i < n; i++) {
    if (mn.find(v[i] - 1) == mn.end() && mn.find(v[i]) == mn.end())
      mn.insert(v[i] + 1);
    if (mx.find(v[i] - 1) == mx.end())
      mx.insert(v[i] - 1);
    else if (mx.find(v[i]) == mx.end())
      mx.insert(v[i]);
    else
      mx.insert(v[i] + 1);
  }
  cout << mn.size() << " " << mx.size();
  return 0;
}
