import Control.Monad

main = do
  li <- getLine
  let n = read li
  as <- forM [1..n] (\_ -> do
    li <- getLine
    return $ read li
    )
  let ans = compute as
  print ans

compute :: [Int] -> Int
compute as = loop as

loop [] = 0
loop (x:xs) = 1 + loop (greedy x xs)

greedy w [] = []
greedy w (x:xs)
  | w < x = greedy x xs
  | True  = x : greedy w xs

