n,k=gets.split.map(&:to_i)
s=gets.chomp
l='.'
t=0
a=[]
s.size.times do |i|
  if l == s[i]
    t+=1
  else
    a << t
    t=1
  end
  l=s[i]
end
a << t
a.unshift 0 if s.size.even?
puts a.size.times.map{|i| (a[2*i,2*k+1] || []).inject(0,&:+)}.max