import Data.Array.IO (IOUArray)
import qualified Data.Array.IO as I

main :: IO()
main = do
    n <- read <$> getLine
    h <- I.newListArray (1, n) =<< map read . words <$> getLine :: IO (IOUArray Int Int)
    print =<< length . filter id <$> mapM (hoge h) [1..n]
    where hoge ls n = do
              h <- I.readArray ls n
              null . filter (\(i, e) -> i <= n && e > h) <$> I.getAssocs ls
