import qualified Data.ByteString.Char8 as BC
import Data.Maybe (fromJust)
import Data.List

(|>) :: a -> (a -> b) -> b
infixl 1 |>
x |> f = f x

($>) :: (Functor m) => m a -> (a -> b) -> m b
infixl 1 $>
x $> f = fmap f x

bsToInt :: BC.ByteString -> Int
bsToInt bs = bs |> BC.readInt |> fromJust |> fst
 
getInt :: IO Int
getInt = BC.getLine $> bsToInt
 
getInts :: IO [Int]
getInts = BC.getLine $> BC.words $> map bsToInt

calc :: [Int] -> Int
calc xs
    | len >= num = len - num
    | otherwise  = len
    where len = length xs
          num = head xs
 
main = do
    getLine
    xs <- getInts
    xs |> sort |> group |> map calc |> sum |> print

    