n, k = io.read("*n", "*n", "*l")
s = io.read()
pos = 1
poslist = {}
cnt = 0
p1, p2 = string.find(s, "1+", pos)
while(p1 ~= nil) do
  cnt = cnt + 1
  poslist[cnt] = {}
  poslist[cnt].fst, poslist[cnt].lst = p1, p2
  pos = p2 + 1
  p1, p2 = string.find(s, "1+", pos)
end

if(#poslist < k) then
  print(n)
else
  res = 0
  for i = 1, #poslist - k do
   res = math.max(res, poslist[i + k].lst - poslist[i].fst + 1)
  end
  res = math.max(res, poslist[k].lst)
  res = math.max(res, n - poslist[#poslist - k + 1].fst + 1)
  print(res)
end
