n, k = list(map(int,input().split()))

s = eval(input()) + '1'

l = []



i = 0

d = []

while i <= n:

    if s[i] == '0':

        d.append(i)



    else:

        if d != []:

            l.append(d)

            d = []

    i += 1



#print(l)



m = 0

nl = len(l)



for i in range(max(nl - k + 1, 1)):

    start = l[i - 1][-1] + 1 if i != 0 else 0

    goal = l[min(i + k, nl - 1)][0] - 1 if not i + k > nl - 1 else n - 1

    #print(start, goal)

    m = max(m, goal - start + 1)



print(m)

n, k = list(map(int,input().split()))

s = eval(input()) + '1'

L = []



i = 0

d = []

while i <= n:

    if s[i] == '0':

        d.append(i)



    else:

        if d != []:

            L.append(d)

            d = []

    i += 1



ans = 0

nl = len(L)



if nl <= k:

    print(n)

else:

    for i in range(nl - k + 1):



        if i == 0:

            sta = 0

        else:

            sta = L[i - 1][-1] + 1



        if i == nl - k:

            end = n - 1

        else:

            end = L[i + k][0] - 1



        ans = max(ans, end - sta + 1)



    print(ans)

n, k = list(map(int, input().split()))
s = eval(input()) + "1"
l = []
i = 0
d = []
while i <= n:
    if s[i] == "0":
        d.append(i)
    else:
        if d != []:
            l.append(d)
            d = []
    i += 1
# print(l)
m = 0
nl = len(l)
for i in range(max(nl - k + 1, 1)):
    start = l[i - 1][-1] + 1 if i != 0 else 0
    goal = l[min(i + k, nl - 1)][0] - 1 if not i + k > nl - 1 else n - 1
    # print(start, goal)
    m = max(m, goal - start + 1)
print(m)

n, k = list(map(int, input().split()))
s = eval(input()) + "1"
L = []
i = 0
d = []
while i <= n:
    if s[i] == "0":
        d.append(i)
    else:
        if d != []:
            L.append(d)
            d = []
    i += 1
ans = 0
nl = len(L)
if nl <= k:
    print(n)
else:
    for i in range(nl - k + 1):
        if i == 0:
            sta = 0
        else:
            sta = L[i - 1][-1] + 1
        if i == nl - k:
            end = n - 1
        else:
            end = L[i + k][0] - 1
        ans = max(ans, end - sta + 1)
    print(ans)

-l = [] +L = [] -            l.append(d) +            L.append(d) -# print(l) -m = 0 -nl = len(l) -for i in range(max(nl - k + 1, 1)): -    start = l[i - 1][-1] + 1 if i != 0 else 0 -    goal = l[min(i + k, nl - 1)][0] - 1 if not i + k > nl - 1 else n - 1 -    # print(start, goal) -    m = max(m, goal - start + 1) -print(m) +ans = 0 +nl = len(L) +if nl <= k: +    print(n) +else: +    for i in range(nl - k + 1): +        if i == 0: +            sta = 0 +        else: +            sta = L[i - 1][-1] + 1 +        if i == nl - k: +            end = n - 1 +        else: +            end = L[i + k][0] - 1 +        ans = max(ans, end - sta + 1) +    print(ans)