#include <bits/stdc++.h>
using namespace std;
int rate_to_col(int rate) {
  if (rate <= 0) return -1;
  if (rate <= 399) return 0;
  if (rate <= 799) return 1;
  if (rate <= 1199) return 2;
  if (rate <= 1599) return 3;
  if (rate <= 1999) return 4;
  if (rate <= 2399) return 5;
  if (rate <= 2799) return 6;
  if (rate <= 3199) return 7;
  return 8;
}
int truncated_max(int num, int t_max) {
  if (num > t_max) return t_max;
  return num;
}
int truncated_min(int num, int t_min) {
  if (num < t_min) return t_min;
  return num;
}
int main() {
  int N, a, n_max = 0, c_index;
  bool col[9] = {false};
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> a;
    c_index = rate_to_col(a);
    col[c_index] = true;
    if (c_index == 8) n_max++;
  }
  int count = 0;
  for (int i = 0; i < 8; i++) {
    if (col[i]) {
      count++;
      cout << count << i << endl;
    }
  }
  if (col[8])
    cout << truncated_min(count, 1) << " " << truncated_max(count + n_max, 8)
         << endl;
  else
    cout << count << " " << count << endl;
  return 0;
}
