N, K = list(map(int, input().split()))

s = eval(input())



X = [0]

if s[0] == "0":

    X.append(0)

for i in range(N):

    if i == N-1 or s[i] != s[i+1]:

        X.append(i+1)

if s[-1] == "0":

    X.append(X[-1])



if len(X) <= K*2+1:

    print(N)

else:

    ma = 0

    for i in range(0, len(X) - K*2 - 1, 2):

        ma = max(X[i+K*2+1]-X[i], ma)

    print(ma)
N, K = list(map(int, input().split()))

s = eval(input())

L = 2 * K + 1

X = [0]*(2-int(s[0])) + [i+1 for i in range(N-1) if s[i]!=s[i+1]] + [N] * L

print((max([X[i+L]-X[i] for i in range(0, len(X)-L, 2)])))
N, K = list(map(int, input().split()))
s = eval(input())
X = [0]
if s[0] == "0":
    X.append(0)
for i in range(N):
    if i == N - 1 or s[i] != s[i + 1]:
        X.append(i + 1)
if s[-1] == "0":
    X.append(X[-1])
if len(X) <= K * 2 + 1:
    print(N)
else:
    ma = 0
    for i in range(0, len(X) - K * 2 - 1, 2):
        ma = max(X[i + K * 2 + 1] - X[i], ma)
    print(ma)

N, K = list(map(int, input().split()))
s = eval(input())
L = 2 * K + 1
X = [0] * (2 - int(s[0])) + [i + 1 for i in range(N - 1) if s[i] != s[i + 1]] + [N] * L
print((max([X[i + L] - X[i] for i in range(0, len(X) - L, 2)])))

-X = [0] -if s[0] == "0": -    X.append(0) -for i in range(N): -    if i == N - 1 or s[i] != s[i + 1]: -        X.append(i + 1) -if s[-1] == "0": -    X.append(X[-1]) -if len(X) <= K * 2 + 1: -    print(N) -else: -    ma = 0 -    for i in range(0, len(X) - K * 2 - 1, 2): -        ma = max(X[i + K * 2 + 1] - X[i], ma) -    print(ma) +L = 2 * K + 1 +X = [0] * (2 - int(s[0])) + [i + 1 for i in range(N - 1) if s[i] != s[i + 1]] + [N] * L +print((max([X[i + L] - X[i] for i in range(0, len(X) - L, 2)])))