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

S = eval(input())



que = [(S[0], 0)]

cur = S[0]

for i in range(1, N):

    if cur != S[i]:

        que.append((S[i], i))

        cur = S[i]



ans = []

LEN = len(que)

for i in range(LEN):

    if que[i][0] == '0':

        if i + 2 * K < LEN:

            ans.append(que[i + 2 * K][1] - que[i][1])

        else:

            ans.append(N - que[i][1])

    else:

        if i + 2 * K + 1 < LEN:

            ans.append(que[i + 2 * K + 1][1] - que[i][1])

        else:

            ans.append(N - que[i][1])

            

print((max(ans)))



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

S = eval(input())



q = [(S[0], 0)]

cur = S[0]

for i in range(1, N):

    if S[i] != cur:

        q.append((S[i], i))

        cur = S[i]



lim = len(q)

ans = []

for i in range(lim):

    if q[i][0] == "0":

        j = i + 2 * K

    else:

        j = i + 2 * K + 1



    if j < lim:

        ans.append(q[j][1] - q[i][1])

    else:

        ans.append(N - q[i][1])



print((max(ans)))

N, K = list(map(int, input().split()))
S = eval(input())
que = [(S[0], 0)]
cur = S[0]
for i in range(1, N):
    if cur != S[i]:
        que.append((S[i], i))
        cur = S[i]
ans = []
LEN = len(que)
for i in range(LEN):
    if que[i][0] == "0":
        if i + 2 * K < LEN:
            ans.append(que[i + 2 * K][1] - que[i][1])
        else:
            ans.append(N - que[i][1])
    else:
        if i + 2 * K + 1 < LEN:
            ans.append(que[i + 2 * K + 1][1] - que[i][1])
        else:
            ans.append(N - que[i][1])
print((max(ans)))

N, K = list(map(int, input().split()))
S = eval(input())
q = [(S[0], 0)]
cur = S[0]
for i in range(1, N):
    if S[i] != cur:
        q.append((S[i], i))
        cur = S[i]
lim = len(q)
ans = []
for i in range(lim):
    if q[i][0] == "0":
        j = i + 2 * K
    else:
        j = i + 2 * K + 1
    if j < lim:
        ans.append(q[j][1] - q[i][1])
    else:
        ans.append(N - q[i][1])
print((max(ans)))

-que = [(S[0], 0)] +q = [(S[0], 0)] -    if cur != S[i]: -        que.append((S[i], i)) +    if S[i] != cur: +        q.append((S[i], i)) +lim = len(q) -LEN = len(que) -for i in range(LEN): -    if que[i][0] == "0": -        if i + 2 * K < LEN: -            ans.append(que[i + 2 * K][1] - que[i][1]) -        else: -            ans.append(N - que[i][1]) +for i in range(lim): +    if q[i][0] == "0": +        j = i + 2 * K -        if i + 2 * K + 1 < LEN: -            ans.append(que[i + 2 * K + 1][1] - que[i][1]) -        else: -            ans.append(N - que[i][1]) +        j = i + 2 * K + 1 +    if j < lim: +        ans.append(q[j][1] - q[i][1]) +    else: +        ans.append(N - q[i][1])