import Data.List

solve :: [Int] -> Int
solve a = go a 0
    where
      go [] _ = 0
      go (x:xs) i =
          let (a',_) = splitAt i a
           in (if all (x <=) a' then 1 else 0) + go xs (i+1)

main :: IO ()
main = do
    _ <- getLine
    a <- map read . words <$> getLine :: IO [Int]
    print $ solve a