import Data.List
import Data.Bool

main = print . solve . map read . words =<< getContents

solve :: [Int] -> Int
solve (n:hs) = r
    where (r, _) = foldl' (\(c, mh) h -> bool (c, mh) (c+1, h) (mh <= h)) (0, 0) hs
