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

s = input().rstrip()





#n, k = 5, 3

#s = "00010"



m = 0

cur_s = cur_e = 0



while True:

  while cur_e < n and s[cur_e] == '1':

    cur_e+=1

  

  if k <= 0 or cur_e >= n:

    wm = cur_e - cur_s

    if wm > m:

      m = wm

      

    if cur_e >= n:

      break

 

    while cur_s < n and s[cur_s] == '1':

      cur_s+=1

    while cur_s < n and s[cur_s] == '0':

      cur_s+=1

    k+=1



  if k > 0:

    while cur_e < n and s[cur_e] == '0':

      cur_e+=1

    k-=1

    

print(m)

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

s = input().rstrip()



#s = "0001111011110"

#n, k = len(s), 1



s="1"+s



k_pt = 0

cur_tail = 0

for cur in range(1, len(s)):

  cur_tail+=1



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

    k_pt+=1



  if k_pt <= k:

      cur_tail-=1

  elif  s[cur_tail] == '0' and s[cur_tail+1] == '1':

    k_pt-=1



print((cur-cur_tail))

n, k = list(map(int, input().split()))
s = input().rstrip()
# n, k = 5, 3
# s = "00010"
m = 0
cur_s = cur_e = 0
while True:
    while cur_e < n and s[cur_e] == "1":
        cur_e += 1
    if k <= 0 or cur_e >= n:
        wm = cur_e - cur_s
        if wm > m:
            m = wm
        if cur_e >= n:
            break
        while cur_s < n and s[cur_s] == "1":
            cur_s += 1
        while cur_s < n and s[cur_s] == "0":
            cur_s += 1
        k += 1
    if k > 0:
        while cur_e < n and s[cur_e] == "0":
            cur_e += 1
        k -= 1
print(m)

n, k = list(map(int, input().split()))
s = input().rstrip()
# s = "0001111011110"
# n, k = len(s), 1
s = "1" + s
k_pt = 0
cur_tail = 0
for cur in range(1, len(s)):
    cur_tail += 1
    if s[cur - 1] == "1" and s[cur] == "0":
        k_pt += 1
    if k_pt <= k:
        cur_tail -= 1
    elif s[cur_tail] == "0" and s[cur_tail + 1] == "1":
        k_pt -= 1
print((cur - cur_tail))

-# n, k = 5, 3 -# s = "00010" -m = 0 -cur_s = cur_e = 0 -while True: -    while cur_e < n and s[cur_e] == "1": -        cur_e += 1 -    if k <= 0 or cur_e >= n: -        wm = cur_e - cur_s -        if wm > m: -            m = wm -        if cur_e >= n: -            break -        while cur_s < n and s[cur_s] == "1": -            cur_s += 1 -        while cur_s < n and s[cur_s] == "0": -            cur_s += 1 -        k += 1 -    if k > 0: -        while cur_e < n and s[cur_e] == "0": -            cur_e += 1 -        k -= 1 -print(m) +# s = "0001111011110" +# n, k = len(s), 1 +s = "1" + s +k_pt = 0 +cur_tail = 0 +for cur in range(1, len(s)): +    cur_tail += 1 +    if s[cur - 1] == "1" and s[cur] == "0": +        k_pt += 1 +    if k_pt <= k: +        cur_tail -= 1 +    elif s[cur_tail] == "0" and s[cur_tail + 1] == "1": +        k_pt -= 1 +print((cur - cur_tail))