n, k = gets.chomp.split.map(&:to_i)
s = gets.chomp.split('')

memory = []
memory_size = 0

max = 0
count = 0
flag = 1
n.times do |i|
  count += 1
  if s[i] == '1'
    if flag == 0
      memory << i
      memory_size += 1
    end
    flag = 1
  else
    if flag == 1
      count = i - memory.shift + 1 if memory_size >= k
    end
    flag = 0
  end
  max = count if max <= count
end

puts(max)