function Picker(input) {
  var lines = input.split('\n');
  var fields = lines.reduce(function(all, line) { return all.concat(line.split(' ')); }, []);
  var p = 0;

  return {
    int: function() {
      return parseInt(fields[p++], 10);
    },
    float: function() {
      return parseFloat(fields[p++]);
    },
    str: function() {
      return fields[p++];
    }
  };
}

function Main(input) {
  var pick = Picker(input);
  var n = pick.int();
  var k = pick.int();
  var s = pick.str();

  var a = s.split(/(0+)/).map(function(e){ return e.length; });
  var max = 0;
  
  for (var i = 0; i < a.length; i += 2) {
    var sum = 0;
    for (var j = 0; j < 2 * k + 1 && i + j < a.length; ++j) {
      sum += a[i + j];
    }
    if (sum > max) {
      max = sum;
    }
  }
  
  console.log(max);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));