let list_to_array n a xs =
  let res = Array.make n a in
  List.iteri (fun i x -> res.(i) <- x) xs;
  res

(* O(n * log(n)) *)
let solve n ds =
  let sorted_ds = list_to_array n 0 ds in
  Array.sort compare sorted_ds;
  Array.fold_left
    (fun (count, last) d ->
      (count + if d <> last then 1 else 0), d)
    (0, -1)
    sorted_ds |> fst

let fold_int f a n =
  let rec fold f a i n =
    if i >= n then
      a
    else
      fold f (f a i) (i + 1) n
  in
    fold f a 0 n

let read_ints n =
  fold_int
    (fun sofar _ -> read_int () :: sofar)
    []
    n |> List.rev

let _ =
  let n = read_int () in
  let ds = read_ints n in
  solve n ds |> string_of_int |> print_endline