#include<stdio.h>
int main(void){
  char *s="python3 -c\""
"t,s=open(0)\n"
"n,k=map(int,t.split())\n"
"l=2*k+1\n"
"x=[0]*(2+int(s[0]))+[i+1for i in range(n-1)if s[i]!=s[i+1]]+[n]*l\n"
"print(max(x[i+l]-x[i]for i in range(0,len(x)-l,2)))\n"
"\"";
  system(s);
  return 0;
}            