import Control.Monad
import Data.Char
import qualified Data.Sequence as S

main = do
    [n, k] <- map read <$> words <$> getLine
    s      <- getLine
    putStrLn $ show $ solve n k s

solve :: Int -> Int -> String -> Int
solve n k s = doit 0 (S.fromList $ replicate k 0) 0 s
  where
    doit :: Int -> (S.Seq Int) -> Int -> String -> Int
    doit d start pos []        = n - S.index start 0
    doit 0 start pos ('1' : t) =      doit 1 (start S.|> pos) (pos + 1) t
    doit 1 start pos ('0' : t) = max (doit 0 (S.drop 1 start) (pos + 1) t) $ pos - S.index start 0
    doit d start pos ( _  : t) =      doit d  start           (pos + 1) t