f s p n l=if null s then n else if head s>=maximum((take l)p) then f (drop 1 s) (drop 1 p) n+1 l+1 else f (drop 1 s) (drop 1 p) n l+1

main=do
 n<-readLn
 s<-map read.words<$>getLine
 let p=replicate n s
 let q=zip [1..n] s
 print$length$filter(==0)$zipWith (\x y->if fst y==1 then 0 else if maximum (take (fst y-1) x) >= snd y then 0 else 1) p q