module Main where

main :: IO ()
main = input >>= (output 0) . reverse


input :: IO [Int]
input = getLine >> getLine >>= return . ((map read) . words)

output :: Int -> [Int] -> IO ()
output i [] = print i
output i (x:xs)
    | all (<=x) xs = output (i+1) xs
    | otherwise = output i xs
