open System

let N : int = stdin.ReadLine() |> int

let d : int list = List.init N (fun _ -> stdin.ReadLine() |> int) |> List.sort

let ans,_ = List.fold (fun (cnt,p) v -> if p <> v then (cnt+1,v) else (cnt,v)) (0,0) d

printfn "%d" ans
