import java.lang.Exception
import java.util.*

fun main(args: Array<String>) {
	
	val scanner = Scanner(System.`in`)
	val N = scanner.nextInt()
	val K = scanner.nextInt()
	val S = scanner.next()
	scanner.close()
	
	
	val array = ArrayList<TwoNum>()
	try {
		var first = -1
		for (i in 0 until N) {
			if (S[i] == '1') {
				if (first == -1) first = i
			} else {
				if (first != -1) {
					array.add(TwoNum(first, i - 1))
					first = -1
				}
			}
		}
		if (first != -1){
			array.add(TwoNum(first, N - 1))
		}
		if (array[0].first != 0) {
			array.reverse()
			array.add(TwoNum(0, 0))
			array.reverse()
		}
		if (array[array.size - 1].last != N - 1) {
			array.add(TwoNum(N - 1, N - 1))
		}
	} catch (e: Exception) {
	
	}
	
	
	if (array.size - 1 <= K) {
		print(N)
		return
	}
	var max = 0
	try {
		for (i in 0 until array.size - K) {
			val temp = array[i + K].last - array[i].first + 1
			max = if (temp > max) temp else max
		}
	} catch (e: Exception) {
		e.printStackTrace()
	}
	print(max)
}

class TwoNum (val first: Int, val last: Int)