import Control.Applicative
import Data.List

solve n [] acc = acc
solve n (x:[]) acc = acc
solve n (x:xs) acc
  | length xs < l = acc
  | otherwise = solve n (tail xs) $ max a acc
  where
  l = ((n * 2) + 1)
  a = (xs !! (l - 1)) - x

main = do
  --[_, n] <- (map read).words <$> getLine :: IO [Int]
  --s <- getLine
  --let n = 3000
  --let s =  concat $ [ "10" | _ <- [0..10000] ]
  let xs = map length $ group s
  let xs' = if head s == '0' then 0:xs else xs
  let sums = scanl' (+) 0 xs'
  print $ solve n sums 0
