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



s=list(eval(input()))



memo = [0]



for i in range(1,n):

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

    memo.append(i)



ans = 0



kyoukai_math = len(memo)



for i in range(kyoukai_math):

  if s[memo[i]] == '1':

    hasi = i+k*2+1

  else:

    hasi = i+k*2

    

  if hasi < kyoukai_math:

    ans = max(ans,memo[hasi]-memo[i])

  else:

    ans = max(ans,n-memo[i])

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



s=list(eval(input()))



border = [0]



for i in range(1,n):

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

        border.append(i)



border_count = len(border)



ans = 0



for i in range(border_count):

    if s[border[i]] == '0':

        block_1 = i+k*2

    else:

        block_1 = i+k*2+1

    #print(block_1, border)

    if block_1 < border_count:

        ans = max(ans, border[block_1]-border[i])

    else:

        ans = max(ans, n-border[i])

print(ans)

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

n, k = list(map(int, input().split()))
s = list(eval(input()))
border = [0]
for i in range(1, n):
    if s[i - 1] != s[i]:
        border.append(i)
border_count = len(border)
ans = 0
for i in range(border_count):
    if s[border[i]] == "0":
        block_1 = i + k * 2
    else:
        block_1 = i + k * 2 + 1
    # print(block_1, border)
    if block_1 < border_count:
        ans = max(ans, border[block_1] - border[i])
    else:
        ans = max(ans, n - border[i])
print(ans)

-memo = [0] +border = [0] -    if s[i] != s[i - 1]: -        memo.append(i) +    if s[i - 1] != s[i]: +        border.append(i) +border_count = len(border) -kyoukai_math = len(memo) -for i in range(kyoukai_math): -    if s[memo[i]] == "1": -        hasi = i + k * 2 + 1 +for i in range(border_count): +    if s[border[i]] == "0": +        block_1 = i + k * 2 -        hasi = i + k * 2 -    if hasi < kyoukai_math: -        ans = max(ans, memo[hasi] - memo[i]) +        block_1 = i + k * 2 + 1 +    # print(block_1, border) +    if block_1 < border_count: +        ans = max(ans, border[block_1] - border[i]) -        ans = max(ans, n - memo[i]) +        ans = max(ans, n - border[i])