let (|Turtle|Crane|) = function | 4 -> Turtle | _ -> Crane let N = stdin.ReadLine() |> int let a = stdin.ReadLine().Split() |> Array.map int let cnts = a |> Array.groupBy(fun x -> x) |> Array.map(fun (k,_) -> k) let gt,lt = (cnts |> Array.max,cnts |> Array.min) if gt = lt then match gt/(N-1) with | Turtle -> (0,N) | Crane -> (N,0) else cnts |> Array.map(fun x -> x = gt) |> (fun x -> let crane = x |> Array.where(fun x -> x) |> Array.length let turtle = N - crane (crane,turtle)) |> (fun (c,t) -> printfn "%i %i" c t)