Scanf.scanf "%d" (fun n ->
    let s = Array.init n (fun _ -> Scanf.scanf " %s" (fun s -> s)) in
    Array.sort compare s;
    let rec loop i prev acc =
        if i = n then acc else
            if s.(i) = prev then loop (i + 1) prev acc
                            else loop (i + 1) s.(i) (acc + 1)
    in
    loop 1 s.(0) 1 |> Printf.printf "%d\n"
)