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)