main :: IO ()
main = do
  n <- getLine
  hn <- map (read :: String -> Int) . words <$> getLine
  print $ ans hn

ans :: [Int] -> Int
ans (x:xs) = (\(a,b,_) -> max a b) $ foldl func (0,0,x) xs where
  func (m,n,e) k = if e >= k then (m,n+1,k)
    else if m >= n then (m,0,k) else (n,0,k)