#!/usr/bin/perl

$line = 0;
while(<>) {
    if($line == 0) {
        ($n) = split /\s+/, $_;
    } else {
        @a = split /\s+/, $_;
    }
    $line++;
}

foreach $r (@a) {
    $d = sprintf("%d", $r / 400);
    if($d < 8) {
        $num{$d}++;
    } else {
        $numm++;
    }
}

$min = keys %num;
$max = $min + $numm;
if($max > 8) {
    $max = 8;
}

print $min, " ", $max, "\n";
