Harryxun/stf_run huggingface dataset:
a, b, c = [int(input()) for i in range(3)]

a_list = list(a)
b_list = list(b)
c_list = list(c)

def decide_turn(list):
    next_turn = list[0]
    del list[0]
    return next_turn

next_turn = decide_turn(a_list)

while 1 > 0:
    if next_turn == a:
        if a_list:
            next_turn = decide_turn(a_list)
        else:
            print('A')
            break
    elif next_turn == b:
        if b_list:
            next_turn = decide_turn(b_list)
        else:
            print('B')
            break
    else:
        if c_list:
            next_turn = decide_turn(c_list)
        else:
            print('C')
            break

### FIXED CODE ###

sa=input()
sb=input()
sc=input()

t='a'
while True:
  if t=='a':
    if sa=='':
      print('A')
      exit()
    t=sa[0]
    sa=sa[1:]
  if t=='b':
    if sb=='':
      print('B')
      exit()
    t=sb[0]
    sb=sb[1:]
  if t=='c':
    if sc=='':
      print('C')
      exit()
    t=sc[0]
    sc=sc[1:]
a = [0]*5
for i in range(5):
  a[i] = input()
k = input()
if (max(a)-min(a))>k:
  print(':(')
else:
  print('Yay!')

### FIXED CODE ###

a = [0]*5
for i in range(5):
  a[i] = int(input())
k = int(input())
if (max(a)-min(a))>k:
  print(':(')
else:
  print('Yay!')
N=int(input())
d=[]
total=0
for i in range(N):
    d.append(int(input()))
for n in range(N):
    for j in range(n+1,N):
        total+=d[n]*d[j]
total

### FIXED CODE ###

N=int(input())
d = list(map(int, input().split()))
total=0
for n in range(N-1):
    for j in range(n+1,N):
        total+=d[n]*d[j]
print(total)
H,N= [int(i) for i in input().split(' ')]
A = [int(i) for i in input().split(' ')]

A.sort()
if A[-1] + A[-2]>= H:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

H,N= [int(i) for i in input().split(' ')]
A = [int(i) for i in input().split(' ')]

if sum(A)>= H:
    print('Yes')
else:
    print('No')
import sys
input=sys.stdin.readline()

n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
b=[0]*m
for _ in range(m):
    if b[-1:]<a[-1:]:
        temp=a.pop()
    else:
        temp=b.pop()
    temp=temp//2
    b[0]=temp
    b.sort()

print(sum(a)+sum(b))


### FIXED CODE ###

s=input()
if s=="Sunny":
    print("Cloudy")
elif s=="Cloudy":
    print("Rainy")
elif s==("Rainy"):
    print("Sunny")
N, K = map(int, input().split())
if((N-1)//(K-1)>=2):print("YES")
else: print("NO")

### FIXED CODE ###

N, K = map(int, input().split())
if(K == 1): print("YES")
else:
    if((N-1)//(K-1)>=2):print("YES")
    else: print("NO")
N = int(input())
A = list(map(int, input().split()))

if A[0]-A[1]>0:
  total = A[0]-A[1]
else:
  total=0 
dif = total
for i in range(1,N-1):
  if (A[i-1]+dif)-A[i]>0:
    total += (A[i-1]+dif)-A[i]
    dif = (A[i-1]+dif)-A[i]
  else:
    dif = 0
print(total)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
 
total = 0
dif = 0
for i in range(1,N):
  if (A[i-1]+dif)-A[i]>0:
    total += (A[i-1]+dif)-A[i]
    dif = (A[i-1]+dif)-A[i]
  else:
    dif = 0
print(total)
n=int(input())
s,t=input().split()
ans=0
for i in range(n):
    ans=ans+s[i]+t[i]
print(ans)

### FIXED CODE ###

n=int(input())
s,t=input().split()
ans=s[0]+t[0]
for i in range(1,n):
    ans=ans+s[i]+t[i]
print(ans)
#import sys
#input = sys.stdin.readline
from collections import defaultdict, deque
def main():
    N, M = map( int, input().split())
    X = list( map( int, input().split()))
    Y = [deque() for _ in range(M)]
    modM = [0]*M
    for i in range(N):
        Y[X[i]%M].append(X[i])
        modM[X[i]%M] += 1
    ans = 0
    if M >= 2:
        ans += modM[0]//2
    for i in range(1,(M+1)//2):
        x, y = i, M-i
        if modM[x] > modM[y]:
            x, y = y, x
        mx, my = modM[x], modM[y]
        ans += mx
        before = -1
        for z in Y[y]:
            if mx+2 > my:
                break
            if before == z:
                ans += 1
                my -= 2
                before = -1
            else:
                before = z
    if M%2 == 0:
        ans += modM[M//2+1]//2
    print(ans)
if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline
from collections import defaultdict
def main():
    N, M = map( int, input().split())
    X = list( map( int, input().split()))
    d = defaultdict( int)
    Same = [0]*M
    Mod = [0]*M
    for x in X:
        Mod[x%M] += 1
        if d[x] > 0:
            d[x] = 0
            Same[x%M] += 2
        else:
            d[x] += 1
    ans = 0
    ans += Mod[0]//2
    Mod[0] = Mod[0]%2
    if M%2 == 0:
        ans += Mod[M//2]//2
        Mod[M//2] = Mod[M//2]%2
    
    for i in range(1,(M+1)//2):
        m = min(Mod[i], Mod[-i])
        ans += m
        Mod[i] = Mod[i] - m
        Mod[-i] = Mod[-i] - m

    for i in range(M):
        ans += min(Mod[i], Same[i])//2
    print(ans)
    
if __name__ == '__main__':
    main()
a = list(input())
a = [int(i) for i in a]
for bit in range(1<<3):
    ans = a[0]
    ans1 = []
    for i in  range(3):
        mask = 1<<i
        if mask&bit:
            ans = (ans+a[i+1])
            ans1.append('+')
        else:
            ans += (ans-a[i+1])
            ans1.append('-')
    
    if ans==7:
        ans2 = ans1
ans3 = []
for i in range(3):
    ans3.append(str(a[i]))
    ans3.append(ans2[i])
ans3.append(str(a[3]))
ans3.append('=7')
ans4 =''.join(ans3)
print(ans4)

### FIXED CODE ###

a = list(input())
a = [int(i) for i in a]
for bit in range(1<<3):
    ans = a[0]
    ans1 = []
    for i in  range(3):
        mask = 1<<i
        if mask&bit:
            ans = (ans+a[i+1])
            ans1.append('+')
        else:
            ans = (ans-a[i+1])
            ans1.append('-')
    
    if ans==7:
        ans2 = ans1
ans3 = []
for i in range(3):
    ans3.append(str(a[i]))
    ans3.append(ans2[i])
ans3.append(str(a[3]))
ans3.append('=7')
ans4 =''.join(ans3)
print(ans4)
while True:
    (H,W) = [int(x) for x in input().split()]
    if H == W == 0:
        break

    for hc in range(H):
    for wc in range(W):
        print('#', end= '')

    print()

print()

### FIXED CODE ###

while True:
    (H,W) = [int(x) for x in input().split()]
    if H == W == 0:
        break
 
    for hc in range(H):
        print('#'*W)
 
    print()
N,m = list(map(int,input().split()))
data = {}
for i in range(N):
	a,b = list(map(int,input().split()))
	data[a] = b
sortedData = sorted(data.items())
cost = 0
for i in range(N):
	prices = sortedData[i][0]
	nums = sortedData[i][1]
	if m > nums:
		cost += prices * nums
		m -= nums
	else:
		cost += prices * m
		print(cost)
		break

### FIXED CODE ###

N,m = list(map(int,input().split()))
data = [[0,0] for i in range(N)]
for i in range(N):
	data[i] = list(map(int,input().split()))
data.sort()
cost = 0
for i in range(N):
	prices,nums = data[i]
	if m > nums:
		cost += prices * nums
		m -= nums
	else:
		cost += prices * m
		print(cost)
		break
a,b,c=map(int,input().split())
if a=b:
  if b=c:
    if a=c:
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')

### FIXED CODE ###

a,b,c=map(int,input().split())
if a==b:
  if b==c:
    if a==c:
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')
n = int(input())
t = []
for i in range(n):
    t.append(int(input()))

def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)
def lcm(a,b):
    return int(a*b/gcd(a,b))

res=1
for i in range(n):
    res = lcm(res,t[i])
print(res)

### FIXED CODE ###

n = int(raw_input())

def gcd(a,b):
    if a > b:
        a,b = b,a
    # a <= b
    while a > 0:
        a,b = b%a, a
    return b

def lcm(a,b):
    g = gcd(a,b)
    return a/g * b

x = 1
for i in range(n):
    ti = int(raw_input())
    x = lcm(x, ti)

print x
num = [i for i in range(0,100001)]

for j in range(1,100001):
        num[j] = j//6 + num[j%6]

for j in range(1,100001):
        num[j] = min(num[j],j//9+num[j%9])

for j in range(1,100001):
        num[j] = min(num[j],j//36+num[j%36])

for j in range(81,324):
        num[j] = min(num[j],1+num[j-81])
for j in range(162,324):
        num[j] = min(num[j],2+num[j-162])
for j in range(243,324):
        num[j] = min(num[j],3+num[j-243])
for j in range(324,100001):
        num[j] = min(num[j],(j//324)*4 + num[j%234])

for j in range(216,648):
        num[j] = min(num[j],1+num[j-216])
for j in range(432,648):
        num[j] = min(num[j],2+num[j-216*2])
for j in range(648,100001):
        num[j] = min(num[j],(j//648)*3 + num[j%648])

for i in range(1,8):
        for j in range(729*i,729*8):
                num[j] = min(num[j],i+num[j-729*i])
for j in range(729*8,100001):
        num[j] = min(num[j],(j//(729*8))*8+num[j%(729*8)])

for i in range(1,9):
        for j in range((6**4)*i,(6**4)*9):
                num[j] = min(num[j],i+num[j-(6**4)*i])
for j in range((6**4)*9,100001):
        num[j] = min(num[j],(j//((6**4)*9))*9+num[j%((6**4)*9)])

for i in range(1,2**4):
        for j in range((9**4)*i,(9**4)*(2**4)):
                num[j] = min(num[j],i+num[j-(9**4)*i])
for j in range((9**4)*(2**4),100001):
        num[j] = min(num[j],(j//((9**4)*(2**4)))*(2**4)+num[j%((6**4)*(2**4))])

MoneyYouCanGet = [6**5,6**6,9**5]

for i in MoneyYouCanGet:
        for j in range(1,100001):
                k = 1
                while k*i<j:
                        num[j] = min(num[j],k+num[j-k*i])
                        k += 1

N = int(input())
print(num[N])

### FIXED CODE ###

SixNum = [i for i in range(0,100001)]
for i in range(1,7):
        for j in range(1,100001):
                SixNum[j] = min(SixNum[j],j//(6**i) + SixNum[j%(6**i)])

NineNum = [i for i in range(0,100001)]
for i in range(1,6):
        for j in range(1,100001):
                NineNum[j] = min(NineNum[j],j//(9**i) + NineNum[j%(9**i)])

N = int(input())
ans = 100001
for i in range(0,N+1):
        ans = min(ans,SixNum[i]+NineNum[N-i])
print(ans)
from itertools import chain
N,K = map(int,input().split())
numarray = list()
num_bool = [0]*(10**5)
numarray_ind = list()

for i in range(N):
    a,b = map(int,input().split())
    num_bool[a-1]+=1
    if(num_bool[a-1]>=2):
        numarray[numarray_ind.index(a)][1]+=b
        # print(numarray)    
        
    else:
        numarray.append([a,b])
        numarray_ind.append(a)

        # print(numarray)    
numarray.sort()
sum_c = 0
i= 0
while all:
    sum_c+=numarray[i][1]
    i+=1
    if(sum_c <=K):
        break
    # print(sum_c,i)
# print(numarray)
print(numarray[i-1][0])


### FIXED CODE ###

from itertools import chain
N,K = map(int,input().split())
num_bool = [0]*(10**5)
numarray_ind = list()

for i in range(N):
    a,b = map(int,input().split())
    num_bool[a-1] += b
# print(num_bool)
sum_count = 0
k=1
for i in range(10**5):
    sum_count += num_bool[i]
    if(sum_count >= K):
        break
    k+=1
print(k)
n = int(input())
c = input()
l = 0
j = 0
a = [0]*n
b = [0]*n
for i in range(n):
  if(c[i]=='W'):
    a[l] =i+1
    l +=1
l = 0
for i in range(n-1,0,-1):
  if(c[i]=='R'):
    b[j] = i+1
    j +=1
j = 0
while(a[l] < b[l]):
      a[l]=0
      b[l]=0
      l+=1
      j+=1
if(a[l+1]==0):
  while(b[l+1]>0):
    j +=1
else:
  while(a[l+1]>0):
    j +=1
print(j)

### FIXED CODE ###

n = int(input())
c = input()
l = 0
j = 0
a = [0]*n
b = [0]*n
for i in range(n):
  if(c[i]=='W'):
    a[l] =i+1
    l +=1
l = 0
for i in range(n-1,0,-1):
  if(c[i]=='R'):
    b[j] = i+1
    j +=1
j = 0
while(a[l] < b[l] and not(a[l]==0 or b[l] == 0)):
      a[l]=0
      b[l]=0
      l+=1
      j+=1
print(j)
PQR = list(map(int, input().split()))
PQR.sort
print(PQR[0]+PQR[1]

### FIXED CODE ###

PQR = list(map(int, input().split()))
PQR.sort(reverse=False)
print(PQR[0]+PQR[1])
import math
N, D = list(map(int, input().split()))
X = []
for i in range(N):
  X.append(list(map(int, input().split())))

count = 0
for a in range(N):
  for b in range(a+1, N):
  sumX = 0
    for c in range(D):
      sumX += (X[a][c]-X[b][c])**2
  if math.sqrt(sumX)%1 == 0:
    count += 1
print(count)

### FIXED CODE ###

import math
N, D = list(map(int, input().split()))
X = []
for i in range(N):
  X.append(list(map(int, input().split())))

count = 0
for a in range(N):
  for b in range(a+1, N):
    sumX = 0
    for c in range(D):
      sumX += (X[a][c]-X[b][c])**2
    if math.sqrt(sumX)%1 == 0:
      count += 1
print(count)
K=int(input())

lis = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(lis[K+1])

### FIXED CODE ###

K=int(input())

lis = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(lis[K-1])
x=input()
print("%d" % x*x*x)

### FIXED CODE ###

x=int(input())
y=x*x*x
print(y)
7
6 7 8
8 8 3
2 5 2
7 8 6
4 6 8
2 3 4
7 5 1

### FIXED CODE ###

n = int(input())
a, b, c = [], [], []
for i in range(n):
    h = input().split(" ")
    a.append(int(h[0]))
    b.append(int(h[1]))
    c.append(int(h[2]))
sum_a, sum_b, sum_c = [a[0]], [b[0]], [c[0]]
for i in range(1, n):
    sum_a.append(a[i] + max(sum_b[i - 1], sum_c[i - 1]))
    sum_b.append(b[i] + max(sum_c[i - 1], sum_a[i - 1]))
    sum_c.append(c[i] + max(sum_a[i - 1], sum_b[i - 1]))
print(max(sum_a[n - 1], sum_b[n - 1], sum_c[n - 1]))
s=int(input())
if s=='ABC':
    print('ARC')
else: print('ABC')

### FIXED CODE ###

s=(input())
if s=='ABC':
    print('ARC')
else: print('ABC')
import math

from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N = int(input())
T = [0] * N
syuki = 0
for i in range(N):
    T[i] = int(input())
print(lcm(*T))


### FIXED CODE ###

from functools import reduce

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def lcm(a, b):
    return a * b // gcd(a, b)

def lcmm(*args):
    return reduce(lcm, args)

N = int(input())
T = [0] * N
syuki = 0
for i in range(N):
    T[i] = int(input())
syuki = lcmm(*T)
print(syuki)
import sys
sys.setrecursionlimit(10**7)

N = int(input())

def DoubleFactorial(n):
    if n == 0 or n == 1:
        return 1
    else:
        return n*DoubleFactorial(n-2)

num = float(DoubleFactorial(N))

count = -1
while num.is_integer():
    num /= 10
    count += 1

print(count)

### FIXED CODE ###

from math import factorial

N = int(input())

if N%2 == 0:
    ans = 0
    devisor = 10
    while devisor <= N:
        ans += N//devisor
        devisor *= 5
    print(ans)   
else:
    print(0)
import numpy as np
from typing import List, Tuple

N = int(input())
X = list(map(int, input()))


def binary_mod(bits: List[int], div: int) -> int:
    val = 0
    for b in bits:
        val = (val * 2 + b) % div
    return val


def f(x):
    cnt = 0
    while x > 0:
        x = x % bin(x).count('1')
        cnt += 1
    return cnt


popcount = sum(X)
div1 = popcount + 1
div2 = popcount - 1

if popcount == 0:
    print('\n'.join(map(str, [1] * N)))
else:
    rem1 = binary_mod(X, div1)
    rem2 = binary_mod(X, div2)

    for i in range(N):
        if X[i] == 0:
            r = (rem1 + pow(2, N - 1 - i, div1)) % div1
            print(f(r) + 1)
        else:
            r = (rem2 - pow(2, N - 1 - i, div2) + div2) % div2
            print(f(r) + 1)


### FIXED CODE ###

import numpy as np
from typing import List, Tuple

N = int(input())
X = list(map(int, input()))


def binary_mod(bits: List[int], div: int) -> int:
    if div == 0:
        return 0

    val = 0
    for b in bits:
        val = (val * 2 + b) % div
    return val


def f(x):
    cnt = 0
    while x > 0:
        x = x % bin(x).count('1')
        cnt += 1
    return cnt


popcount = sum(X)
div1 = popcount + 1
div2 = popcount - 1

if popcount == 0:
    print('\n'.join(map(str, [1] * N)))
else:
    rem1 = binary_mod(X, div1)
    rem2 = binary_mod(X, div2)

    for i in range(N):
        if X[i] == 0:
            r = (rem1 + pow(2, N - 1 - i, div1)) % div1
            print(f(r) + 1)
        else:
            if div2 > 0:
                r = (rem2 - pow(2, N - 1 - i, div2) + div2) % div2
                print(f(r) + 1)
            else:
                print(0)
#16D8101023J 久保田凌弥 kubotarouxxx python

x=int(input(""))

y=x**3

print(y)


### FIXED CODE ###

# 16D8101023J 久保田凌弥 kubotarouxxx python

x=int(input(""))

y=x**3

print(y)
N= int(input())
s = []

for _ in range(N):
    s.append(input())

for i in range(N):
    s[i] = [*s[i]]
    s[i] = sorted(s[i])

counter = 0
for i in range(N):
    for j in range((i+1), N):
        if s[i] == s[j]:
            counter += 1

print(counter)  

### FIXED CODE ###

N= int(input())
s = []

for _ in range(N):
    s.append(input())

for i in range(N):
    s[i] = tuple(sorted(s[i]))

import collections
c = collections.Counter(s)
d = [i for i in c.values()]

counter = 0
from math import factorial
for i in d:
    if i > 1:
        counter += i*(i-1)/2

print(int(counter))
def resolve():
    N,x=map(int,input().split())
    X=list(map(int,input().split()))
    X.append(x)
    X=list(set(X))
    X.sort()
    D=[]
    for i in range(len(X)-1):
        D.append(X[i+1]-X[i])
    import math
    import functools
    gcd = functools.reduce(math.gcd, D)
    print(gcd)
resolve()


### FIXED CODE ###

def gcd(a, b):
    while a > 0:
        if a < b:
            a, b = b, a
        a = a % b
    return b
def resolve():
    N,x=map(int,input().split())
    X=list(map(int,input().split()))
    X.append(x)
    X=list(set(X))
    X.sort()
    D=[]
    for i in range(len(X)-1):
        D.append(X[i+1]-X[i])
    ans=D[0]
    for d in D:
        if d%ans!=0:
            ans=gcd(ans,d)
    print(ans)
resolve()
n, *a = map(int, input().split())
li = []
sorted_a = sorted(a)
for i in range(n):
    if sorted_a[i] != a[i]:
        cnt +=1
        li.append(i)
        


def hantei(n, a, li):
    if len(li) >= 3:
        return('NO')

    elif len(li) <= 1:
        return('YES')

    else:
        a[li[0]], a[li[1]] = a[li[1]], a[li[0]]
        for i in range(n):
            if sorted_a[i] != a[i]:
                return('NO')
        return('YES')

    
print(hantei(n, a, li))

### FIXED CODE ###

from collections import defaultdict, deque
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate
import sys


def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LIM(): return list(map(lambda x:int(x) - 1, sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def LIRM(n): return [LIM() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
mod = 1000000007


def main():
    n = I()
    num = LI()
    for i in range(n):
        for j in range(n):
            tmp = num.copy()
            tmp[i], tmp[j] = tmp[j], tmp[i]
            if tmp == sorted(num):
                return 'YES'
    return 'NO'


print(main())
N=int(input())
LA=list(map(int,input().split()))
ans=[]

def gcd(m,n):
    while n:
        m,n=n,m%n
    return m

from functools import reduce
def multigcd(item):
    return reduce(gcd, item)

for n in range(N):
    L=LA[:n]+LA[n+1:]
    ans.append(multigcd(L))

print(max(ans))

### FIXED CODE ###

A,B,T=map(int,input().split())

print(B*(T//A))
N =int(input())
lisA =sorted(list(map(int,input().split())))
lisB = sorted(list(map(int,input().split())))
lisC = sorted(list(map(int,input().split())))



print(sum(bisect.bisect_left(lisA,b)*(N-bisect.bisect_right(lisC,b))for b in  lisB))

### FIXED CODE ###

import bisect
N =int(input())
lisA =list(map(int,input().split()))
lisB = list(map(int,input().split()))
lisC = list(map(int,input().split()))

lisA.sort()
lisB.sort()
lisC.sort()
cnt = 0

for b in lisB:
    cnt += bisect.bisect_left(lisA,b)*(N-bisect.bisect_right(lisC,b))

print(cnt)
n, m = [int(input()) for i in range(2)]
print((n-1)*(m-1))

### FIXED CODE ###

n, m = map(int, input().split())
print((n-1)*(m-1))
N=int(input())
a=input()
num=[]
num.append(int(a.split()[0]))
num.append(int(a.split()[1]))
num.append(int(a.split()[2]))
num.append(int(a.split()[3]))

num.sort()
b=0
for i in range(len(num)-1):
  b+=num[i]
if(num[len(num)-1]<b): print('Yes')
else: print('No')

### FIXED CODE ###

N=int(input())
a=input()
num=[]
n=a.split()
for i in(n):
  num.append(int(i))

num.sort()
b=0
for i in range(len(num)-1):
  b+=num[i]
if(num[len(num)-1]<b): print('Yes')
else: print('No')
n, k = map(int, input().split())
s = input()
s_split_0 = s.split("1")
s_split_1 = s.split("0")

s_split_1= [len(i) for i in s_split_1 if i!=""]
s_split_0= [len(i) for i in s_split_0 if i!=""]

if s[0]=="1":
    print(max([sum(s_split_0[i:i+k])+sum(s_split_1[i:i+k+1]) for i in range(len(s_split_0)-k+1)]))
else:
    print(max([sum(s_split_0[i:i+k])+sum(s_split_1[i:i+k]) for i in range(len(s_split_1)-k+1)]))


### FIXED CODE ###

import sys
input =  sys.stdin.readline

n, k = map(int, input().split())
s = input()+'-1'

cnt = 0
cnt_list = []
for i in range(n):
    if s[i] == s[i+1]:
        cnt += 1
    else:
        cnt_list.append(cnt+1)
        cnt = 0

# print(cnt_list)


l = 0
r = 2*k
ma = 0
su = 0
if s[0] == '0':
    r = 2*k
else:
    r = 2*k+1
su = sum(cnt_list[l:r])
while l < r:
    if ma < su:
        ma = su
    if l == 0 and r == 2*k:
        l += 1
        su -= cnt_list[l-1]
    else:
        l += 2
        su -= sum(cnt_list[l-2:l])
    r += 2
    su += sum(cnt_list[r-2:r])
    if r >= len(cnt_list):
        r = len(cnt_list)
    
print(ma)
mod_673 = [1] * 672
for i in range(1,672):
    mod_673[i] = (mod_673[i -1] * 10) % 673

S = input()
S = S[::-1]
A = [0] * (len(S) + 1)
B = [0] * (len(S) + 1)
x = 0
Ans = [[0] * 3 for i in range(673)]
for i in range(1, len(S) + 1):
    A[i] = (A[i - 1] + int(S[i - 1]) * mod_673[(i - 1) % 673]) % 673
    B[i] = (B[i - 1] + int(S[i - 1])) % 3

for i in range(len(S) + 1):
    Ans[A[i]][B[i]] += 1

for i in range(673):
    for j in range(3):
        y = Ans[i][j]
        x += y * (y - 1) // 2

print(x)

### FIXED CODE ###

mod_673 = [1] * 672
for i in range(1,672):
    mod_673[i] = (mod_673[i -1] * 10) % 673

S = input()
S = S[::-1]
A = [0] * (len(S) + 1)
B = [0] * (len(S) + 1)
x = 0
Ans = [[0] * 3 for i in range(673)]
for i in range(1, len(S) + 1):
    A[i] = (A[i - 1] + int(S[i - 1]) * mod_673[(i - 1) % 672]) % 673
    B[i] = (B[i - 1] + int(S[i - 1])) % 3

for i in range(len(S) + 1):
    Ans[A[i]][B[i]] += 1

for i in range(673):
    for j in range(3):
        y = Ans[i][j]
        x += y * (y - 1) // 2

print(x)
d='SUN,MON,TUE,WED,THU,FRI,SAT'.split(',')
s=input()
print(7 - d.find(s))

### FIXED CODE ###

d='SUN,MON,TUE,WED,THU,FRI,SAT'.split(',')
s=input()
print(7 - d.index(s))
n = int(input())
a = list(map(int, input().split()))
minus_count = 0
for i in a:
    if i < 0:
        minus_count += 1
a = [abs(e) for e in a]
if minus_count % 2 != 0:
    a_min = a.pop(a.index(min(a)))
ans = sum(a) - a_min
print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
a_min = 0
minus_count = 0
for i in a:
    if i < 0:
        minus_count += 1
a = [abs(e) for e in a]
if minus_count % 2 != 0:
    a_min = a.pop(a.index(min(a)))
ans = sum(a) - a_min
print(ans)
a = int(input())
b = input()
c = input()
d = input()
e = input()
k = input()
if e - a <= k:
    print("Yey!")
else:
    print(":(")

### FIXED CODE ###

a = int(input())
b = input()
c = input()
d = input()
e = int(input())
k = int(input())
if e - a <= k:
    print("Yay!")
else:
    print(":(")