n,k=gets.split.map(&:to_i)
s = gets
#s= '1'+s if s[0] == '0'
#s= s+ '0' if s[-1] == '1'
g = Regexp.new("^1*" + (k).times.map { '0*' }.join('1*') + "1*")
p n.times.map { |m| i=s.to_s.match(g); s.sub!(/^1*0+/,'') ;i.to_s.size  }.max
