solveSub [_] = 0
solveSub (a:b:s) | a >= b = 1 + (solveSub (b:s))
                 | otherwise = 0

solve [] = []
solve as = g : solve (drop (g+1) as)
           where
               g = solveSub as

main = do
    n <- readLn :: IO Int
    hn <- map read . words <$> getLine :: IO [Int]
    print $ maximum (solve hn)