import Control.Applicative ((<$>))
import Data.List (group)

main :: IO ()
main = do
  _ <- getLine
  as <- map read . words <$> getLine
  print $ solve as

solve :: [Int] -> Int
solve = go 1 1
  where
    go m n [] = m `max` n
    go m n (x:xs)
      | x == 0
        = go (m `max` n) 1 xs
      | x == 1
        = go m (n+1) xs
