N, K = gets.split.map &:to_i
S = gets.chomp.chars.map &:to_i
ans = k = l = r = 0
until l == N
  until r == N || k == K
    if S[r].zero?
      k += 1
      r += 1 while r < N && S[r].zero?
    end
    r += 1 while r < N && S[r].odd?
  end
  ans = [ans, r - l].max
  s = S[l]
  k -= 1 if s.zero?
  l += 1 while l < N && S[l] == s
end
p ans
