program main
   implicit none
   character(100000)s
   integer n,k
   integer ::i,ma=1,counter=0,j=1
   integer ::a(100000)=0
   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
   if(j<=2*k)then
      write(*,*)n
   endif
   do i=1,n-2*k,2
      if(ma<sum(a(i:i+k*2)))ma=sum(a(i:i+k*2))
   enddo
   write(*,'(i0)')ma
end program main
