import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T

main :: IO ()
main = do
  let
    f :: [Int] -> (Int, Maybe (Int, Int))
    f = foldl step (0, Nothing)
      where
        step :: (Int, Maybe (Int, Int)) -> Int -> (Int, Maybe (Int, Int))
        step (m, Nothing) h = (m, Just (0, h))
        step (m, Just (l, h')) h | h <= h'   = (m, Just (l + 1, h))
                                 | otherwise = (m `max` l, Just (0, h))
  n <- unsafeTextToInt <$> T.getLine :: IO Int
  hs <- map unsafeTextToInt . T.words <$> T.getLine :: IO [Int]
  print . uncurry max . fmap (maybe 0 fst) . f $ hs

unsafeTextToInt :: T.Text -> Int
unsafeTextToInt s = case T.signed T.decimal s of
  Right (n, _) -> n
{-# INLINE unsafeTextToInt #-}
