import Data.List
import qualified Data.Vector as V
f :: V.Vector [Char] -> Int -> Int -> [Int]
f s i k= if null s then [] else (((sum.V.map length.V.take (if (head(V.head s))=='1' then 2*k+1 else 2*k))s):(f (V.tail s) (i+1) k))
main=do
 [n,k]<-map read.words<$>getLine
 s<-V.fromList.group<$>getLine
 print(if (V.length s)<div k 2 then n else maximum(f s 0 k))