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())

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

l += [i for i in range(1,n) if s[i-1] != s[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())
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())
l = [0, 0] if (s[0] == "0") else [0]
l += [i for i in range(1, n) if s[i - 1] != s[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))))

-for i in range(1, n): -    if s[i - 1] != s[i]: -        l += [i] +l += [i for i in range(1, n) if s[i - 1] != s[i]] -if ll <= pl: +if ll < pl: