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

s = eval(input())



c = 1

l = []

l += [0,0] if (s[0] == '0') else [0]



for i in range(1, n):

    if s[i-1] != s[i]:

        l += [c+l[-1]]; c = 1;

    else:

        c +=1



l += [c+l[-1]]

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

   l += [l[-1]]



ll = len(l)

pl = 2 * k + 1



if ll <= pl:

    print(n)

else: 

    m = 0

    for i in range(0, ll-pl+1, 2):

        t = l[pl+i]-l[i]; m = t if (t > m) else m

    print(m)

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

s = eval(input())

l = [0,0] if (s[0] == '0') else [0]

for i in range(1, n):

    if s[i-1] != s[i]:

        l += [i];

l += [n] if (s[-1] == '1') else [n,n]

ll = len(l)

pl = 2 * k + 1

if ll <= pl:

    print(n)

else: 

    print((max(l[pl+i]-l[i] for i in range(0, ll-pl+1, 2))))

n, k = list(map(int, input().split()))
s = eval(input())
c = 1
l = []
l += [0, 0] if (s[0] == "0") else [0]
for i in range(1, n):
    if s[i - 1] != s[i]:
        l += [c + l[-1]]
        c = 1
    else:
        c += 1
l += [c + l[-1]]
if s[-1] == "0":
    l += [l[-1]]
ll = len(l)
pl = 2 * k + 1
if ll <= pl:
    print(n)
else:
    m = 0
    for i in range(0, ll - pl + 1, 2):
        t = l[pl + i] - l[i]
        m = t if (t > m) else m
    print(m)

n, k = list(map(int, input().split()))
s = eval(input())
l = [0, 0] if (s[0] == "0") else [0]
for i in range(1, n):
    if s[i - 1] != s[i]:
        l += [i]
l += [n] if (s[-1] == "1") else [n, n]
ll = len(l)
pl = 2 * k + 1
if ll <= pl:
    print(n)
else:
    print((max(l[pl + i] - l[i] for i in range(0, ll - pl + 1, 2))))

-c = 1 -l = [] -l += [0, 0] if (s[0] == "0") else [0] +l = [0, 0] if (s[0] == "0") else [0] -        l += [c + l[-1]] -        c = 1 -    else: -        c += 1 -l += [c + l[-1]] -if s[-1] == "0": -    l += [l[-1]] +        l += [i] +l += [n] if (s[-1] == "1") else [n, n] -    m = 0 -    for i in range(0, ll - pl + 1, 2): -        t = l[pl + i] - l[i] -        m = t if (t > m) else m -    print(m) +    print((max(l[pl + i] - l[i] for i in range(0, ll - pl + 1, 2))))