{-# LANGUAGE OverloadedStrings #-}
import Data.Maybe
import Data.Char
import Data.List
import Data.Function
import qualified Data.ByteString.Char8 as BS
import qualified Data.Vector.Unboxed as VU

main :: IO()
main = do
  getLine
  ns <- getIntList
  print . maximum . unfoldr slice $ ns

slice [] = Nothing
slice (n:ns) = Just $ cut n ns
  where
    cut n [] = (0, [])
    cut n mss@(m:ms)
      | n >= m = let (n, ls) = cut m ms in (n+1, ls)
      | otherwise = (0, mss)

-- IO
readInt :: BS.ByteString -> Int
readInt = fst . fromJust . BS.readInt

getInt :: IO Int
getInt = readInt <$> BS.getLine

getIntList :: IO [Int]
getIntList = unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine

getIntVec :: Int -> IO (VU.Vector Int)
getIntVec n = VU.unfoldrN n (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine
