program main
   implicit none
   character(100000)s
   integer n,k
   integer ::i,ma=1,counter=0,j=1
   integer ::a(110000)=0,suma
   read(*,*)n,k
   read(*,*)s
   do i=1,n
      if(mod(j,2)==1)then
        if(s(i:i)=="1")then
          a(j)=a(j)+1
        else
          j=j+1
        endif
        cycle
      else
        if(s(i:i)=="0")then
          a(j)=a(j)+1
        else
          j=j+1
        endif
      endif
      cycle
   enddo
   a(2:j)=a(2:j)+1
   suma=sum(a)
   do i=1,j,2
      if(ma<sum(a(i:i+2*k)))ma=sum(a(i:i+2*k))
      if(ma==suma)exit
   enddo
   write(*,*)ma
end program main
