object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)

    val N, K = sc.nextInt()
    sc.nextLine()
    val S: Array[Char] = sc.nextLine().toCharArray

    var left = 0
    while (left < N && S(left) == '1')
      left += 1

    var k = 0
    var right = left
    while (k < K) {
      while (right < N && S(right) == '0')
        right += 1
      while (right < N && S(right) == '1')
        right += 1
      k += 1
    }

    var max = right - left
    while (left < N && right < N) {
      while (left < N && S(left) == '0')
        left += 1
      while (left < N && S(left) == '1')
        left += 1
      while (right < N && S(right) == '0')
        right += 1
      while (right < N && S(right) == '1')
        right += 1
      max = Math.max(max, right - left + 1)
    }

    println(max)
  }

}