module Main where
import Data.List
main = interact $ printer . solver . parser
int = read :: String -> Int

printer = unlines . (:[]) . show
parser = map int . tail . words

solver is = sum v3
  where
    v1 = sort is
    v2 = group v1
    v3 = map delcnt v2
    delcnt ss
      | v5 < v4 = v5
      | v5 > v4 = v5 - v4
      | otherwise = 0
      where
        v4 = head ss
        v5 = length ss


