main = do
    [n,k] <- (map read . words) <$> getLine :: IO [Int]
    s <- getLine
    let s' = 0:0:preproc s++[0,0]
    let s'' = postproc (k*2+1) s'
    print $ maximum s''


preproc :: String -> [Int]
preproc s = let h = head s in
            if h == '0' then 0:preprocAux h 0 s
                        else   preprocAux h 0 s
    where
        preprocAux :: Char -> Int -> String -> [Int]
        preprocAux cur ac [] = if cur=='0' then [ac,0] else [ac]
        preprocAux cur ac xx@(x:xs) = if x == cur
            then    preprocAux x (ac+1) xs
            else ac:preprocAux x 1 xs

postproc :: Int -> [Int] -> [Int]
postproc n xs
    | length xs >= n = sum (take n xs):postproc n (drop 2 xs)
    | otherwise      = []