Harryxun/stf_run huggingface dataset:
S = sorted(list(set(list(input()))))
test = sorted('abcdefghijklmnopqrstuvwxyz')
for num in range(len(S)):
    if num == 26:
        ans ='None'
        break
    if S[num] != test[num]:
        ans = num
        break
print('None' if ans=='None' else test[num] )

### FIXED CODE ###

S = sorted(list(set(list(input()))))
test = sorted('abcdefghijklmnopqrstuvwxyz')
ans = -1
if S == test:
    print('None')

elif S[-1] == test[len(S)-1]:
    print(test[len(S)])

else:
    for num in range(len(S)):
        if test[num] != S[num]:
            print(test[num])
            break
r = int(input())
import math
print("{:f}".format(math.pi*r**2),"{:f}".format(2*math.pi*r))

### FIXED CODE ###

r = float(input())
pi = 3.14159265359
print("{:f}".format(pi*r**2),"{:f}".format(2*pi*r))
import sys

sys.setrecursionlimit(2*10**5)
input = sys.stdin.readline

n, q = map(int, input().split())
graph = {i: [] for i in range(n)}
for a, b in [[int(i)-1 for i in input().split()] for _ in range(n-1)]:
    graph[a].append(b)
    graph[b].append(a)
ans = [0] * n
for p, x in [[int(i) for i in input().split()] for _ in range(q)]:
    ans[p-1] += x

def dfs(now, parent):
    if parent != -1:
        ans[now] += ans[parent]
    for i in graph[now]:
        if i == parent:
            continue
        dfs(i, now)

dfs(0, -1)
print(' '.join(map(str, ans)))


### FIXED CODE ###

import sys

sys.setrecursionlimit(10**7)
input = sys.stdin.readline

n, q = map(int, input().split())
graph = {i: [] for i in range(n)}
for a, b in [[int(i)-1 for i in input().split()] for _ in range(n-1)]:
    graph[a].append(b)
    graph[b].append(a)
ans = [0] * n
for p, x in [[int(i) for i in input().split()] for _ in range(q)]:
    ans[p-1] += x

def dfs(now, parent):
    if parent != -1:
        ans[now] += ans[parent]
    for i in graph[now]:
        if i == parent:
            continue
        dfs(i, now)

dfs(0, -1)
print(' '.join(map(str, ans)))
s = int(input())
w = int(input())

if w>=s :
  print("unsafe")
else : 
  print("safe")

### FIXED CODE ###

s, w = map(int, input().split())
print('safe') if s > w else print('unsafe')
a = [input(),input(),input()]
l = [len(a[0]),len(a[1]),len(a[2])]
ans = l[0]+l[1]+l[2]

def check(a0, l0, a1, l1, delta):
    # stt1 >= stt0, stt1 - stt0 >=l0 must return True
    i = delta
    j = 0
    while (i<l0) and (j<l1):
        if a0[i] != a1[j]:
            if a0[i] != '?' and a1[j] != '?':
                return False
        i += 1
        j += 1
    return True

memo = [[[1]*4000 for i in range(3)] for j in range(3)]
comb2 = [(0,1),(1,0),(1,2),(2,1),(0,2),(2,0)]
for x, y in comb2:
    me = memo[x][y]
    a0, a1 = a[x],a[y]
    l0, l1 = l[x],l[y]
    for delta in range(0,l0):
        if not check(a0,l0, a1,l1, delta):
            me[delta] = 0

comb = [(0,1,2),(0,2,1),(1,0,2),(1,2,0),(2,1,0),(2,0,1)]
for i,j,k in comb:
    l0, l1, l2 = l[i],l[j],l[k]
    stt0 = 0
    for stt1 in range(0,l0+1):
        if not memo[i][j][stt1-stt0]:
            continue
        l01 = max(l0,stt1+l1)
        for stt2 in range(stt1,l01+1):
            if not memo[j][k][stt2-stt1]:
                continue
            if not memo[i][k][stt2-stt0]:
                continue
            l012 = max(l01,stt2+l2)
            ans = min(ans,l012)
print(ans)

### FIXED CODE ###

a = [input(),input(),input()]
l = [len(a[0]),len(a[1]),len(a[2])]
ans = l[0]+l[1]+l[2]

def check(a0, l0, a1, l1, delta):
    # stt1 >= stt0, stt1 - stt0 >=l0 must return True
    i = delta
    j = 0
    while (i<l0) and (j<l1):
        if a0[i] != a1[j]:
            if a0[i] != '?' and a1[j] != '?':
                return False
        i += 1
        j += 1
    return True

memoLen = ans-min(l[0],l[1],l[2])+1
memo = [[[1]*memoLen for i in range(3)] for j in range(3)]
comb2 = [(0,1),(1,0),(1,2),(2,1),(0,2),(2,0)]
for x, y in comb2:
    me = memo[x][y]
    a0, a1 = a[x],a[y]
    l0, l1 = l[x],l[y]
    for delta in range(0,l0):
        if not check(a0,l0, a1,l1, delta):
            me[delta] = 0

comb = [(0,1,2),(0,2,1),(1,0,2),(1,2,0),(2,1,0),(2,0,1)]
for i,j,k in comb:
    l0, l1, l2 = l[i],l[j],l[k]
    for stt1 in range(0,l0+1):
        if memo[i][j][stt1]:
            l01 = max(l0,stt1+l1)
            for stt2 in range(stt1,l01+1):
                if memo[j][k][stt2-stt1] and memo[i][k][stt2]:
                    l012 = max(l01,stt2+l2)
                    ans = min(ans,l012)
print(ans)
import itertools as it
import math
from statistics import mean
N=int(input())
X=[list(map(int,input().split())) for i in range(N)]
A=[]
for i in list(it.permutations(X,N)):
    B=[]
    for j in range(N-1):
        B.append(math.sqrt((i[j][0]-i[j+1][0])**2+(i[j][1]-i[j+1][1])**2))
    A.append(sum(B))
print(mean(A))

### FIXED CODE ###

import itertools as it
import math
from statistics import mean
N=int(input())
X=[list(map(int,input().split())) for i in range(N)]
A=[]
for i in list(it.permutations(X,N)):
    B=[]
    for j in range(N-1):
        B.append(math.sqrt((i[j][0]-i[j+1][0])**2+(i[j][1]-i[j+1][1])**2))
    A.append(sum(B))
print(mean(A))
a,b,c = map(int,input().split()) 
if b−a == c−b:
  print('YES')
else:
  print('NO')


### FIXED CODE ###

a,b,c = map(int,input().split()) 
if b-a == c-b:
  print('YES')
else:
  print('NO')
lines = []
while True:
    line = input()
    if line:
        lines.append(line)
    else:
        break

c = 0
p = 0
curr_no = -1
for line in lines[1:]:
    curr = line.split()
    if(curr_no != curr[0]):
        curr_no = curr[0]
        curr_flag = True
    if(curr_flag):
        if(curr[1] == "AC"):
            c += 1
            curr_flag = False
        else:
            p += 1

print(c, p)


### FIXED CODE ###

from collections import defaultdict

params = input().split()
n = int(params[0])
m = int(params[1])

penaltyCount = dict()
penaltyCount = defaultdict(lambda: 0, penaltyCount)

correct = 0
penalty = 0

for i in range(m):
    submission = input().split()
    p = int(submission[0]) - 1
    status = submission[1]

    if penaltyCount[p] == -1:
        continue
    if status == "WA":
        penaltyCount[p] += 1
    else:
        penalty += penaltyCount[p]
        penaltyCount[p] = -1
        correct += 1

print(str(correct) + " " + str(penalty))
import sys
class Dice:
    def __init__(self, f):
        self.f = f[:]

    def to_top(self, index):
        if index == 1:
            self.roll('N')
        elif index == 2:
            self.roll('W')
        elif index == 3:
            self.roll('E')
        elif index == 4:
            self.roll('S')
        elif index == 5:
            self.roll('NN')
        return self

    def side_roll(self):
        t  = self.f[1]
        self.f[1] = self.f[2]
        self.f[2] = self.f[4]
        self.f[4] = self.f[3]
        self.f[3] = t
        return self

    def all_face(self):
        faces = []
        for i in range(0,6):
            t = Dice(self.f[:])
            faces.append(t.to_top(i).f)
            for j in range(3):
                faces.append(t.side_roll().f)
        return faces

d1, d2 = (Dice(list(input().split())) for _ in range(2))
fs = d1.all_face()
print('Yes' if d2.f in fs else 'No')

### FIXED CODE ###

import sys
class Dice:
    def __init__(self, f):
        self.f = f[:]

    def roll(self, s):
        for f in s:
            n = self.f[:]
            if f == 'E':
                t = n[0]
                n[0] = n[3]
                n[3] = n[5]
                n[5] = n[2]
                n[2] = t
            elif f == 'W':
                t = n[0]
                n[0] = n[2]
                n[2] = n[5]
                n[5] = n[3]
                n[3] = t
            elif f == 'N':
                t = n[0]
                n[0] = n[1]
                n[1] = n[5]
                n[5] = n[4]
                n[4] = t
            else:
                t = n[0]
                n[0] = n[4]
                n[4] = n[5]
                n[5] = n[1]
                n[1] = t
            self.f = n

    def to_top(self, index):
        if index == 1:
            self.roll('N')
        elif index == 2:
            self.roll('W')
        elif index == 3:
            self.roll('E')
        elif index == 4:
            self.roll('S')
        elif index == 5:
            self.roll('NN')
        return self

    def side_roll(self):
        t  = self.f[1]
        self.f[1] = self.f[2]
        self.f[2] = self.f[4]
        self.f[4] = self.f[3]
        self.f[3] = t
        return self

    def all_face(self):
        faces = []
        for i in range(0,6):
            t = Dice(self.f[:])
            faces.append(t.to_top(i).f[:])
            for j in range(3):
                faces.append(t.side_roll().f[:])
        return faces

d1, d2 = (Dice(list(input().split())) for _ in range(2))
fs = d1.all_face()
print('Yes' if d2.f in fs else 'No')
N=int(input())
A=list(map(int,input().split()))
l=[]
for a in A:
  b=0
  while a%2==0:
    a//=2
    b+=1
  l.append(b)
print(min(b))

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
l=[]

for a in A:
    b=0
    while a%2==0:
        a//=2
        b+=1
    l.append(b)
print(min(l))
import sys
import math
from collections import deque
import bisect

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def main():
    N = NI()
    W = NLI()
    cum = []
    cum.append(W[0])
    for i in range(1, len(W)):
        cum.append(cum[-1] + W[i])
    total = cum[-1]
    idx = bisect.bisect_left(cum, total/2)
    idx_r = bisect.bisect_right(cum, total / 2)
    print(min(abs(total-cum[idx]*2), abs(total-cum[idx_r+1]*2)))


if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
import math
from collections import deque
import bisect

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def main():
    N = NI()
    W = NLI()
    cum = []
    cum.append(W[0])
    for i in range(1, N):
        cum.append(cum[-1] + W[i])
    total = cum[-1]
    idx = 0
    for i in range(N):
        if cum[i] <= total / 2:
            idx = i
        else:
            idx_r = i
            break
    print(min(abs(total - cum[idx]*2) ,abs(total - cum[idx_r]*2)))




if __name__ == "__main__":
    main()
N, P = map(int, raw_input().split())
if N == 1:
    print P
else:
    res = 2
    for i in range(2, int(N ** (1/2.)) + 1):
        if i ** N > P:
            break
        if P % (i ** N) == 0:
            res = i
    print res


### FIXED CODE ###

N = raw_input()
print len([i for i in N if i == '2'])
A , B , M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = []
for i in range(M-1):
    q = list(map(int, input().split()))
    x = a[q[0]-1] + b[q[1]-1] - q[2]
    ans.append(x)
print(min(ans))

### FIXED CODE ###

A , B , M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = [min(a) + min(b)]
for i in range(M):
    q = list(map(int, input().split()))
    x = a[q[0]-1] + b[q[1]-1] - q[2]
    ans.append(x)
print(min(ans))
n,l=map(int,input().split())
taste_list=[]
for i in range(1,n+1):
    taste_list.append(l+i-1)
#taste=sum(taste_list)
if taste_list[0]>0:
    print(taste-taste_list[0])
else:
    print(taste-taste_list[n-1])

### FIXED CODE ###

n,l=map(int,input().split())
taste_list=[]
for i in range(1,n+1):
    taste_list.append(l+i-1)
taste=sum(taste_list)
if taste_list[0]>0:
    print(taste-taste_list[0])
elif 0 in taste_list:
    print(taste)
else:
    print(taste-taste_list[n-1])
h, w = map(int, input().split())
s = [input() + '#' for _ in range(h)]
s.append('#' * w)

yoko = [[0] * w for _ in range(h)]
for i in range(h):
  si = s[i]
  for j in range(w):
    if si[j] == '.':
      start = j
      jj = j + 1
      break
  for j in range(jj, w + 1):
    if si[j] == '#':
      if start != -1:
        for k in range(start, j):
          yoko[i][k] = j - start
        start = -1
    else:
      if start == -1:
        start = j

tate = [[0] * w for _ in range(h)]
for i in range(w):
  if s[0][i] == '.':
    start = 0
  else:
    start = -1
  for j in range(1, h + 1):
    if s[j][i] == '#':
      if start != -1:
        for k in range(start, j):
          tate[k][i] = j - start
        start = -1
    else:
      if start == -1:
        start = j

result = 0
for i in range(h):
  yokoi = yoko[i]
  tatei = tate[i]
  for j in range(w):
    t = yokoi[j] + tatei[j] - 1
    if t > result:
      result = t

print(result)


### FIXED CODE ###

h, w = map(int, input().split())
s = [input() + '#' for _ in range(h)]
s.append('#' * w)

yoko = [[0] * w for _ in range(h)]
for i in range(h):
  if s[i][0] == '.':
    start = 0
  else:
    start = -1
  for j in range(1, w + 1):
    if s[i][j] == '#':
      if start != -1:
        for k in range(start, j):
          yoko[i][k] = j - start
        start = -1
    else:
      if start == -1:
        start = j

tate = [[0] * w for _ in range(h)]
for i in range(w):
  if s[0][i] == '.':
    start = 0
  else:
    start = -1
  for j in range(1, h + 1):
    if s[j][i] == '#':
      if start != -1:
        for k in range(start, j):
          tate[k][i] = j - start
        start = -1
    else:
      if start == -1:
        start = j
result = 0
for i in range(h):
  for j in range(w):
    t = yoko[i][j] + tate[i][j] - 1
    if t > result:
      result = t

print(result)
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# スペース区切りの整数の入力
b, c = map(int, input().split())
# 文字列の入力
s = input()
# 出力
print("{} {}".format(a+b+c, s))

### FIXED CODE ###

r = int(input())
print(r*r)
import math

n, X = map(int, input().split())
x = list(map(int, input().split()))

if n == 1:
    print(abs(X-x[0]))
    exit()

x.append(X)

x.sort()

xx=[]

for i in range(1,n+1):
    xx.append(x[i]-x[i-1])

xgcd = math.gcd(xx[0],xx[1])

if n == 2:
    print(xgcd)
    exit()

for i in range(2,n):
    xgcd=math.gcd(xgcd,xx[i])
print(xgcd)

### FIXED CODE ###

import fractions

n, X = map(int, input().split())
x = list(map(int, input().split()))

xx = []

for i in range(n):
    xx.append(abs(x[i]-X))

if n == 1:
    print(xx[0])
else:
    xg = xx[0]
    for i in range(1,n):
        xg = fractions.gcd(xg,xx[i])
    print(xg)
import sys
from decimal import Decimal

def main():

    #input_strings = sys.stdin.readlines()
    for coef_and_cons in input_strings:
        a, b, c, d ,e, f = map(Decimal, coef_and_cons.split())
        print([a,b,c,d,e,f])
        x = (f/e - c/b) / (d/e - a/b)
        y = (f/d - c/a) / (e/d - b/a)
        print('%.3f %.3f' %  (x.quantize(Decimal('0.001'), rounding='ROUND_HALF_DOWN'),
                              y.quantize(Decimal('0.001'), rounding='ROUND_HALF_DOWN') )
             )


main()

### FIXED CODE ###

import sys
from decimal import Decimal
from fractions import Fraction

def main():

    input_strings = sys.stdin.readlines()
    for matrix_string in input_strings:
        matrix = list(map(Fraction, list(matrix_string.split())))
        if matrix[0] == 0:
            matrix = matrix[3:] + matrix[:3]
        matrix = list(map(lambda x: x / matrix[0], matrix[:3])) + matrix[3:]
        matrix = matrix[:3] + list(map(lambda x: x[1] - matrix[3] * x[0], zip(matrix[:3], matrix[3:])))
        matrix = matrix[:3] + list(map(lambda x: x / matrix[4], matrix[3:]))
        matrix = list(map(lambda x: x[0] - matrix[1] * x[1], zip(matrix[:3], matrix[3:]))) + matrix[3:]
        matrix = list(map(float, matrix))
        matrix = list(map(Decimal, matrix))
        matrix = list(map(lambda x: x.quantize(Decimal('.001'), rounding='ROUND_HALF_UP'), matrix))

        print('%.3f %.3f' % (matrix[2], matrix[5]))
main()
n=int(input())
lista = [int(i) for i in input().split()]

import fractions

list_ans=[]

for i in range(n):
	listb=lista.copy()
	listb.pop(i)
#	print(listb)

	ans= listb[0]

	for i in range(1,n-1):
		ans=fractions.gcd(ans,listb[i])
#	print(ans)
	list_ans.append(ans)
	print(max(list_ans))


	

### FIXED CODE ###

n=int(input())
lista = [int(i) for i in input().split()]

import fractions
import copy

listb=[]
listc=[]
ansb= lista[0]

for i in range(1,n-1):
	ansb=fractions.gcd(ansb,lista[i])
#	print(ansb)
	listb.append(ansb)

#print(int(max(list_ans)))
ansc= lista[n-1]

for i in range(n-2,0,-1):
	ansc=fractions.gcd(ansc,lista[i])
#	print(ansc)
	listc.append(ansc)


list_b=[lista[0]]
listb=[1]+list_b+listb
list_c=[lista[n-1]]
listc=list(reversed(listc))+list_c+[1]
#print(listb)
#print(listc)

ans=0
list_ans=[listc[0],listb[n-1]]
for i in range(1,n-1):
	ans=fractions.gcd(listb[i],listc[i])
	list_ans.append(ans)
	
ansans=max(list_ans)

if n==2:
	ansans=max(lista[0],lista[1])
	
print(ansans)
N = int(input())
P = list(map(int,input().split()))
Q = list(map(int,input().split()))

def calculate(n,p,q):
    x = 0
    y = 0

    for index,ar in enumerate(itertools.permutations([i for i in range(1,n+1)],n)):
        if list(ar) == list(p):
            x = index

        if list(ar) == list(q):
            y = index

    if x >= y:
        print(x-y)
    else:
        print(y-x)
calculate(N,P,Q)

### FIXED CODE ###

import itertools
# N = 3
# P = [1, 3, 2]
# Q = [3, 1, 2]
#
# N = 8
# P = [7, 3, 5, 4, 2, 1, 6, 8]
# Q = [3, 8, 2, 5, 4, 6, 7, 1]
#
#
# N = 3
# P = [1, 2, 3]
# Q = [1, 2, 3]

N = int(input())
P = list(map(int,input().split()))
Q = list(map(int,input().split()))

def calculate(n,p,q):
    x = 0
    y = 0

    for index,ar in enumerate(itertools.permutations([i for i in range(1,n+1)],n)):
        if list(ar) == list(p):
            x = index

        if list(ar) == list(q):
            y = index

    if x >= y:
        print(x-y)
    else:
        print(y-x)
calculate(N,P,Q)
from fractions import gcd

n,m=map(int,input().split())
s=input()
t=input()
l=n*m//gcd(n,m)
x=[0]*(l)
for i in range(n):
    x[i*(l//n)]=s[i]
for j in range(m):
    if x[j*(l//m)]!=0:
        if x[j*(l//m)]!=t[j]:
            print(-1)
            exit()
print(l)

### FIXED CODE ###

from fractions import gcd

n,m=map(int,input().split())
s=input()
t=input()
x=gcd(n,m)
l=n*m//gcd(n,m)
for i in range(x):
    if s[i*(n//x)]!=t[i*(m//x)]:
        print(-1)
        exit()
print(l)
import math
import time

t = time.time()
def iip():
    return [int(i) for i in input().split()]

H, N = iip()
mp_for_damage = [10**9 for i in range(H+1)]
mp_for_damage[0] = 0

for i in range(N):
    a, b = iip()
    for j in range(H+1):
        for k in range(1, a):
            mp_for_damage[k] = min(mp_for_damage[k], b)

        if j + a > H:
            break
        mp_for_damage[j+a] = min(mp_for_damage[j+a], mp_for_damage[j] + b)

#print(mp_for_damage)
print(mp_for_damage[H])

#print(time.time() - t)

### FIXED CODE ###

import math
import time


t = time.time()
def iip():
    return [int(i) for i in input().split()]

def main():
    H, N = iip()
    mp_for_damage = [10**9 for i in range(H+1)]
    mp_for_damage[0] = 0
    ab = []

    for i in range(N):
        ab.append(iip())

    ab= sorted(ab, key=lambda x:x[0]/x[1], reverse=True)

    for i in range(N):
        a, b = ab[i]

        for k in range(1, min(a, H) + 1):
            mp_for_damage[k] = min(mp_for_damage[k], b)
            # print(k, b)

        if a >= H:
            mp_for_damage[H] = min(mp_for_damage[H], b)
            continue

        if a < H and mp_for_damage[a] < b:
            continue

        for j in range(H-a+1):
            mp_for_damage[j+a] = min(mp_for_damage[j+a], mp_for_damage[j] + b)

    #print(mp_for_damage)
    #print(mp_for_damage)
    print(mp_for_damage[H])

    #print(time.time() - t)

main()
N = int(input())
A = list(map(int,input().split()))
B = list((i for i in A if i % 2 == 0))

count = 0

for i in B:
    if i%3 == 0 or i%5 == 0:
        count += 1
    else:
        count += 0

if int(count) == int(len(B)):
    print("APROVED")
else:
    print("DENIED")

### FIXED CODE ###

A = list(map(int,input().split()))
A_unique = list(set(A))
A_length = len(A_unique)

if A_length == 2:
    print("Yes")

else:
    print("No")
a = input()
b = input()
print(a*b)

### FIXED CODE ###

A,B =map(int,input().split())
print(A*B)
s = input()
k = int(input())
i = 0
while s[i] == '1':
  i += 1
if i == 0 or k <= i:
  print(1)
else:
  print(int(s[i]))

### FIXED CODE ###

s = input()
k = int(input())
i = 0
l = len(s)
while s[i] == '1':
  if i >= l-1:
    break
  i += 1
if i == 0 or k <= i:
  print(s[0])
else:
  print(s[i])
W,H,x,y,r = map(int, raw_input().split())
if r <= x <= W - r and r <= y <= H - r:
print "Yes"
else:
print "No"

### FIXED CODE ###

W,H,x,y,r = map(int, input().split())
if r <= x <= W-r and r <= y <= H-r:
    print ('Yes')
else:
    print ('No')
from itertools import groupby
from numpy import cumsum


N, K = map(int, input().split())
S = input().strip()

if len(set(S)) == 1:
    print(N)
    exit()

# ランレングス圧縮
G = []
for k, v in groupby(S):
    G.append(len(list(v)))
# 1 0 1 0 1...の配列が欲しいので、
# 先頭、末尾が0ならダミーの要素をそれぞれ追加する
if S[0] == '0':
    G.insert(0, 0)
if S[-1] == '0':
    G.append(0)

cum = [0]
cum.extend(list(cumsum(G)))
cum.append(0)

ans = 0
gc = len(G)
w = min(gc, 3+(K-1)*2)
for i in range(0, w, 2):
    ans = max(ans, cum[i+w]-cum[i])
print(ans)


### FIXED CODE ###

from itertools import groupby
from numpy import cumsum


N, K = map(int, input().split())
S = input().strip()

if len(set(S)) == 1:
    print(N)
    exit()

G = []
if S[0] == '0':
    G.append(0)
for k, v in groupby(S):
    G.append(len(list(v)))
G.append(0)

cum = [0]
cum.extend(list(cumsum(G)))
cum.append(0)

ans = 0
gc = len(G)
w = min(gc, 3+(K-1)*2)
for i in range(0, gc-w+2, 2):
    ans = max(ans, cum[i+w]-cum[i])
print(ans)
a = list(map(int, input().split())).sorted(reversed=True)
N = int(input())
print((2 ^ N) * a[0] + a[1] + a[2])

### FIXED CODE ###

a = sorted(list(map(int, input().split())), reverse=True)
N = int(input())
print((2 ** N) * a[0] + a[1] + a[2])
n=input()
p=list(map(int,input().split()))
cnt=0
for i in p:
  if(p[i]!=i):
    cnt+=1

if(cnt<=2):
  print("YES")
else:
  print("NO")

### FIXED CODE ###

n=input()
p=list(map(int,input().split()))
cnt=0
for i in range(len(p)):
  if(p[i]!=i+1):
    cnt+=1

if(cnt<=2):
  print("YES")
else:
  print("NO")
N,K=map(int,input().split())
P=list(map(int,input().split()))
cnt=0
tmp=0
ans=0
count=0
for i in range(N-K+1):
	#print(P[i:i+K])
	if cnt<sum(P[i:i+K]):
		cnt=sum(P[i:i+K])
		tmp=i
Q=P[tmp:tmp+K]
count=collections.Counter(Q)
C_K=list(count.keys())
C_V=list(count.values())
R=len(count)
for i in range(R):
	ans+=(C_K[i]*(C_K[i]+1)/(2*C_K[i])*C_V[i])
print(ans)

### FIXED CODE ###

N,K=map(int,input().split())
P=list(map(int,input().split()))
E=[0]*N

for i in range (N):
	E[i]=((P[i]+1)/2)

L=[0]*(N+1)
L[0]=0

for i in range (N):
	L[i+1]=L[i]+E[i]

ans=0

for i in range (K,N+1):
	ans=max(ans,L[i]-L[i-K])

print(ans)
import numpy as np
S = input()
T = input()

if len(S)==0:
    print(0)
else:
    tmp = np.zeros(len(T))

    i=0
    flg=True

    while flg:
        for j in range(i, len(T)):
            if T[i:j+1] in S:
                tmp[i] = j+1-i
        i = max(i + int(tmp[i]),i+1)
        if i >= len(T)-1:
            flg=False

    tmp = np.array(tmp, dtype=int)
    i = np.argmax(tmp)
    j = tmp[i]
    s = S.find(T[i:i+j])
    if s - i >= 0 and s - i + len(T) <= len(S):
        print(len(T)-int(np.max(tmp)))
    else:
        l=0
        for k in range(len(T)):
            if S[s+k] == T[k]:
                l+=1
        print(len(T)-l)

### FIXED CODE ###

S=input()
T=input()
ls=len(S)
lt=len(T)
ans=lt
for i in range(0,ls-lt+1):
    a=0
    for j in range(lt):
        if S[i+j]==T[j]:
            a+=1
    ans=min(ans,lt-a)
print(ans)