<?php
$a = 0;
$l = $b = [];
while ($r = trim(fgets(STDIN)))
    $l[] = $r;
$l[1] = array_map("intval", explode(" ", $l[1]));
foreach (["h", "c", "m", "z", "a", "y", "k", "r", "o"] as $value)
    $b[$value] = null;
foreach ($l[1] as $value) {
    if ($value >= 3200) {
        $a += 1;
    } elseif ($value >= 3199) {
        $b["r"] = 1;
    } elseif ($value >= 2799) {
        $b["k"] = 1;
    } elseif ($value >= 2399) {
        $b["y"] = 1;
    } elseif ($value >= 1999) {
        $b["a"] = 1;
    } elseif ($value >= 1599) {
        $b["z"] = 1;
    } elseif ($value >= 1199) {
        $b["m"] = 1;
    } elseif ($value >= 799) {
        $b["c"] = 1;
    } elseif ($value >= 399) {
        $b["h"] = 1;
    }
}
$c = count(array_filter($b, function ($v) {
    return !is_null($v);
}));
echo (isset($a) ? ($c - $a > 0 ? $c : abs($c - $a) + $c) : $c) . " " . (isset($a) ? $c + $a : $c);