module Int = struct
  type t = int
  let compare = compare
end

module Im = Map.Make(Int)

let id x = x

let mk_map n =
  let rec aux n' m =
    if n' <= 0 then m
    else
      let a = (Scanf.scanf "%d " id) / 400 in
      let v = try Im.find (min a 8) m with _ -> 0 in
      aux (pred n') (Im.add a (succ v) m)
  in
  aux n Im.empty

let solve m =
  if Im.mem 8 m then
    let ma = Im.cardinal m + Im.find 8 m - 1 in
    let mi = max (Im.cardinal m - 1) 1 in
    ma, mi
  else
    let ma = Im.cardinal m in
    ma, ma

let () =
  let ma, mi = mk_map (Scanf.scanf "%d\n" id) |> solve in
  Printf.printf "%d %d\n" mi ma