Scanf.scanf "%d" (fun n -> let module M = Map.Make (struct type t = int let compare = compare end) in let rec loop i map = if i = n then map else let map = Scanf.scanf " %d"(fun a -> M.add a (1 + try M.find a map with _ -> 0) map) in loop (i + 1) map in let map = loop 0 M.empty in M.fold (fun k v acc -> if v = 1 then acc + 1 else acc) map 0 |> Printf.printf "%d\n" )