let group_by cmp lst = let rec group_by' lst result = match lst with | [] -> result | x::xs -> let value = cmp x in let lst1, lst2 = List.partition (fun v -> value = cmp v) lst in group_by' lst2 ((value, lst1)::result) in group_by' lst [] let id x = x let () = let _ = read_line () in let alst = read_line () |> Str.split (Str.regexp_string " ") in group_by id alst |> List.map (fun (key, vlst) -> List.length vlst) |> List.filter (( = ) 1) |> List.length |> print_int; print_newline ()