function Main(input){
  var nks = input.split('\n');
  var nk = nks[0].split(' '); 
  var n = nk[0]
  var ktem = nk[1]
  var k = ktem
  var s = nks[1].split('');
  count = 0
  res = []

  for(var index = 0; index < n; index++){
    count = 0;
    for(var j = index; j < n; j++){
      if(s[j] == 1){
        // 普通
        count++;
      } else if(s[j] == 0 && k > 0){
        // count開始
        for(var t = j; t < n; t++){
          if(s[t] == 0){
            count++;
            j++;
          } else{
            count++;
            k--;
            break;
          }
        }
      } else if(s[j] == 0 && k <= 0){
        res.push(count);
        k = ktem;
        break;
      }
    }
    res.push(count);
    k = ktem;
  }
  // console.log(res)
  console.log(Math.max.apply(null,res))
  }
  Main(require("fs").readFileSync("/dev/stdin","utf-8"));