import Data.List -- sort
import Control.Monad -- replicateM

readInt = read <$> getLine :: IO Integer
arrayInt = map read . words <$> getLine :: IO [Integer]
writeln x = putStrLn $ unwords x :: IO ()

main = do
    n <- readInt
    hs <- arrayInt
    print $ solve hs 0 0


solve [] m s = s
solve (h:hs) m s
    | m <= h = solve hs h (s+1)
    | otherwise = solve hs m s