main = do
  li <- getLine
  let n = read li
  li <- getLine
  let ps = map read $ words li
  let ans = compute n ps
  print ans

compute :: Int -> [Int] -> Int
compute n ps = length $ filter id $ zipWith (>=) (scanl min (n+1) ps) ps
