function Main(input) {
  var k = input.split("\n")[0].split(" ")[1];
  var s = input.split("\n")[1];
  var list = [];
  var prev = "";
  if(s[0]==0)list.push(0);
  for(var i=0; i<s.length; i++){
  	if(prev==s[i]){
    	list[list.length-1]++;
    }else{
    	list.push(1);
      	prev = s[i];
    }
  }
  var max = 0;
  for(var i=0; i+2*k<input.length; i+=2){
    var sum = 0;
  	for(var j=0; j<2*k+1; j++){
    	sum += list[i+j];
    }
    if(sum>max)max = sum;
  }
  console.log(max);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));