#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int a[n], i, j;
  for (i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n);
  set<long long int> s;
  for (i = 0; i < n; ++i) {
    if (s.find(a[i] - 1) != s.end())
      s.insert(a[i] - 1);
    else if (s.find(a[i]) != s.end())
      s.insert(a[i]);
    else
      s.insert(a[i] + 1);
  }
  cout << s.size() << " ";
  s.clear();
  for (i = 0; i < n; ++i) {
    if (s.find(a[i] - 1) == s.end())
      s.insert(a[i] - 1);
    else if (s.find(a[i]) == s.end())
      s.insert(a[i]);
    else
      s.insert(a[i] + 1);
  }
  cout << s.size() << " ";
  return 0;
}
