Scanf.scanf "%d" (fun n ->
    let a = Array.init n (fun _ -> Scanf.scanf " %d" (fun a -> a)) in

    let rec loop i arr g =
        if i = n then (
            let s = Array.fold_left (fun acc v -> if v > 0 then acc + 1 else acc) 0 arr in
            let mi = if s = 0 then 1 else s in
            let mx = min (s + g) 8 in
            Printf.printf "%d %d\n" mi mx
        ) else (
            if a.(i) < 3200 then (
                let () = arr.(a.(i) / 400) <- arr.(a.(i) / 400) + 1 in
                loop (i + 1) arr g 
            ) else loop (i + 1) arr (g + 1)
        )
    in
    loop 0 (Array.make 8 0) 0
)