#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
const double EPS = 1e-10;
const double PI = acos(-1.0);
int colornum[9];
const int colorrate[9] = {399, 799, 1199, 1599, 1999, 2399, 2799, 3199, 4800};
int a, N;
int main() {
  cin >> N;
  for (int i = (0); i < (N); ++i) {
    cin >> a;
    for (int j = 0; j < 9; j++) {
      if (a <= colorrate[j]) {
        colornum[j]++;
        break;
      }
    }
  }
  cout << "H C Md Mi A K D A R" << endl;
  for (int i = (0); i < (9); ++i) {
    cout << colornum[i] << " ";
  }
  cout << endl;
  int sum = 0;
  int sum_min = 0;
  for (int i = 0; i < 8; i++) {
    if (colornum[i] != 0) {
      sum++;
    }
  }
  sum_min = sum;
  if (sum == 0 && colornum[8] != 0) {
    sum_min = 1;
  }
  if (colornum[8] != 0 && sum < 8) {
    for (int j = 0; j < colornum[8]; j++) {
      sum++;
    }
  }
  cout << sum_min << " " << sum << endl;
}
