import qualified Data.ByteString.Char8 as BS 
f :: [Int] -> Int
f [] = 0
f (x:xs) = if length(filter (x <=) xs) == length(xs) then (1 +(f xs)) else (0 + f xs)
main = do
 a <- BS.getLine
 s <- map (read . BS.unpack) . BS.words <$> BS.getLine
 print $ f (reverse s)