module Main where

import           Control.Monad
import           Data.List
import           Data.Ord
import           Data.List.Split
import           Data.Array.IO
import qualified Data.Vector.Unboxed as V

main :: IO ()
main = do
  [n, k] <- map read . words <$> getLine :: IO [Int]
  s <- getLine :: IO String
  let sums = (V.fromList . scanl (+) 0 . count . group) s
  print . maximum $ f sums k
  where
    count cs =
      let xs = if (head . head) cs == '0' then []:cs    else cs
          ys = if (even . length) xs then xs ++ [] else xs
      in  map length ys
    f sums k =
      let ls = V.length sums
          a  = 2 * k + 1
      in  [(sums V.! min (i + a) (ls - 1)) - (sums V.! i) | i <- [0,2..(ls - 1)]]
