const main = (input) => {
  var ip = input.trim().split("\n")[0].split(" ");
  var N = ip[0]-0;
  var K = ip[1]-0;
  if(N<=K/2){
    console.log(N);
    return;
  }
  var inputs = input.trim().split("\n")[1].split("");
  var ans = 0;
  for(var s=0;s<inputs.length;s++){
    var cnt = 0, zflg=false,zcnt=0, tans = 0;
    if(s == 0 || (inputs[s-1] == 0 && inputs[s] == 1)){
      for(var e=s;e<inputs.length;e++){
        if(inputs[e]==0 && zflg==false){
          zcnt++;
          zflg = true;
          if(K<zcnt) break;
        }else if(inputs[e] == 1){
          zflg = false;
        }
        tans++;
      }
      ans = Math.max(ans, tans);
    }
  }
  console.log(ans);
}

main(require('fs').readFileSync('/dev/stdin', 'UTF-8'));
