import Control.Applicative
import Data.List

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

main = do
  [_, n] <- (map read).words <$> getLine :: IO [Int]
  s <- getLine
  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
