(* O(N * log(N)) (N = |xs|) *)
(* unique : ('a -> 'a -> int) -> 'a list -> 'a list = <fun> *)
let unique (type u) (cmp : u -> u -> int) =
  let module S = Set.Make(struct type t = u let compare = cmp end) in
  fun xs -> S.elements (List.fold_right S.add xs S.empty)

(* O(n * log(n)) *)
let solve n ds = unique compare ds |> List.length

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