import Control.Monad
import Control.Applicative
import Data.List
import qualified Data.Map as M
import qualified Data.Vector as V
import qualified Data.Vector.Mutable as VM





getBysplit = map read . words <$> getLine


count :: [String] -> [Int]
count lst = let
              xs = if (head . head) lst == '0' then [] : lst else lst
              ys = if (head . last) lst == '0' then xs ++ [] else xs
            in map length ys


solve :: Int -> V.Vector Int -> Int -> Int
solve width vec limit = foldl f 0 [0,2..limit]
      where
        f acc x = let
                    left = vec V.! x
                    right = vec V.! min (x + width) limit
                  in max (right - left) acc

main :: IO ()
main = do
  [n, k] <- getBysplit :: IO [Int]
  s <- getLine :: IO String
  let nums = (count . group) s --group 連続するものをリストに分割して二次元リストを返す
  let sums = scanl (+) 0 nums -- 累積和を作成する関数
  let width = 2 * k + 1
  let vec = V.fromList  sums
  let limit = length nums
  print $ solve width vec limit
