peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
X, Y, A, B, C = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort()
p.reverse()
q.sort()
q.reverse()
r.sort()

l = X+Y
lst = []
for i in range(X):
  lst.append(p[i])

for i in range(Y):
  lst.append(q[i])

for i in r:
  lst.append(i)

lst.sort()
lst.reverse()

ans = 0
for i in range(l):
  ans += lst[i]

print(ans)
# Judge status: Accepted
import sys

N = int(input())
A = list(map(int, input().split()))
A.sort()
if A[0] == 0:
    print(0)
    sys.exit()
    
ans = 1
cond = 0
for a in A:
    ans *= a
    if ans > 10**18:
        cond = 1
        break

if cond:
    print(-1)
else:
    print(ans)
# Judge status: Accepted
s=input()

if int(s[:4]) < 2019:
    print("Heisei")
else:
    if s[5:7] in ["01","02","03","04"]:
        print("Heisei")
    else:
        print("TBD")
# Judge status: Wrong Answer
chars = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]
N = int(input())

def solve(s = "", depth = 0):
  if len(s) == N:
    print(s)
    return
  
  for i in range(depth + 1):
    solve(s + chars[i], depth + 1)

solve()
# Judge status: Wrong Answer
X, Y = map(int, input().split())
if Y % X == 0:
    print(-1)
else:
    if X % Y == 0:
        print(-1)
    else:
        print(X)
# Judge status: Wrong Answer
import numpy as np

N = int(input())
D = [int(x) for x in input().split()]
D = np.array(D)
D_unique = np.unique(D)

for i in range(1, N):
    num = np.sum(D == i)
    print(num)
# Judge status: Wrong Answer
s = list(str(input()))
t = list(str(input()))

x = [0]
a = 0
for i in range(len(t)):
    for k in range(len(s)):
        if(t[i] == s[k] and ((len(s)- k) >= (len(t)-i)) and (k >= i)):
            a += 1
            for n in range(1,(len(t)-i)):
                if(t[i+n] == s[k+n]):
                    a += 1
                    
    x.append(a)
    a = 0

y = max(x) 

print((len(t) - y))
# Judge status: Accepted
x = int(input())
if x%11==0:
    print(2*(x//11))
else:
    print(2*(x//11) + (2 if x%11 > 6 else 1))
# Judge status: Wrong Answer
n = int(input())
s=input()
if '#' not in s:
    print(0)
else:
    firstb = s.index('#')
    s2 = s[firstb:]
    s2b = s2.count('#')
    s2w = len(s2)-s2b
    print(min(s2b,s2w))
# Judge status: Wrong Answer
N= int(input())

sum = 0
for i in range(1, N):
    if (i % 3 != 0 and i % 5 != 0 and i % 15 != 0):
        sum = sum + i
        print(sum)
# Judge status: Accepted
import sys
import collections
import bisect
import math
import time


def main():
    n = input()
    if len(n) == 1:
        print(int(n))
        return

    if len(n) - list(n).count("0") >= 2:
        print(sum(list(map(lambda x: int(x), list(n)))))
        return

    if n[0:2] == "10":
        print(10)
        return

    print(n[0])


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
S = input()
print('yes' if len(S) != len(set(S)) else 'no')
# Judge status: Accepted
n = int(input())
l = list(map(int,input().split()))
if max(l)<sum(l)-max(l):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
N,K = map(int,input().split())
A = list(map(int,input().split()))
L = 0
R = max(A)
while int(R)-int(L) > 1:
    X = (L+R)/2
    m = 0
    for i in range(N):
        c = A[i]/X
        if c == int(c):
            m += int(c) - 1
        else:
            m += int(c)
    if m <= K:
        R = X
    else:
        L = X
print(int(R))
# Judge status: Wrong Answer
N,M = map(int,input().split())
A = list(map(int, input().split()))
total = sum(A)
cutoff = total/N

over=[]
for i in A:
    if i>=cutoff:
        over.append(i)

if len(over)>=M:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n, k = map(int, input().split())
sunuke = [0] * n
for _ in range(k):
    d = int(input())
    a_li = list(map(int, input().split()))
    for a in a_li:
        sunuke[a - 1] += 1
print(sunuke.count(0))
# Judge status: Wrong Answer
x, y = map(int, input().split())

dic = {'A': [1, 3, 5, 7, 8, 10, 12], 'B': [4, 5, 6, 11], 'C': [2]}

gx = 0
gy = 0
for key, value in dic.items():
    if x in value:
        gx = key
    if y in value:
        gy = key
ans = 'Yes' if gx == gy else 'No'
print(ans)
# Judge status: Accepted
#ABC150_D

from fractions import gcd
N,M=map(int,input().split())
A=list(map(int,input().split()))
lcm=A[0]//2

for x in A:
    x//=2
    g=gcd(lcm,x)
    
    if (lcm//g)%2!=(x//g)%2:
        print(0)
        exit()
    
    lcm=lcm*x//g
print((M//lcm+1)//2)
# Judge status: Wrong Answer
import collections
N=int(input())
S=list(input())
s=collections.Counter(S)
m=0
m+=s["R"]*s["G"]*s["B"]
for i in range(N-2):
  for j in range(i+1,N-1):
    k=2*j-i
    if k>=N:
      break
    if s[i]!=s[j] and s[i]!=s[k] and s[j]!=s[k]:
      m-=1
# Judge status: Accepted
N, x = map(int,input().split())
a = list(map(int,input().split()))
a = sorted(a)
ans = 0
for i in range(len(a) - 1):
    x -= a[i]
    if x >= 0:
        ans += 1
    else:
        break
x -= a[N - 1]
if x == 0:
    ans += 1
print(ans)
# Judge status: Accepted
n,l=map(int,input().split())
if l <= 0 and l+n-1 >= 0:
  ate=0
elif l > 0:
  ate=l
else: # l+n-1 < 0
  ate=l+n-1
  
print((l-1)*n+n*(n+1)//2-ate)
# Judge status: Accepted
n = int(input())
def func(n, i):
    ans = 0
    while n>0:
        ans += n%i
        n //= i
    return ans
b=n
for i in range(n+1):
    tmp = func(i, 6) + func(n-i, 9)
    b = min(tmp, b)
print(b)
# Judge status: Accepted
n,m = map(int,input().split())

if n*2>=m:
    print(m//2)
else:
    tmp=m-n*2
    print(n+tmp//4)
# Judge status: Accepted
n = int(input())
lis = [int(input()) for i in range(n)]

ans = 0
for i in range(n):
    temp, mod = divmod(lis[i], 2)
    ans += temp
    if i < n-1 and lis[i+1] != 0:
        lis[i+1] += mod

print(ans)
# Judge status: Wrong Answer
A11, A12, A13 = input().split(' ')
A21, A22, A23 = input().split(' ')
A31, A32, A33 = input().split(' ')
N = int(input())
b = []
for i in range(N):
  b = input()
if A11 and A12 and A13 in b:
  print('Yes')
elif A21 and A22 and A23 in b:
  print('Yes')
elif A31 and A32 and A33 in b:
  print('Yes')
elif A11 and A21 and A31 in b:
  print('Yes')
elif A12 and A22 and A32 in b:
  print('Yes')
elif A13 and A23 and A33 in b:
  print('Yes')
elif A11 and A22 and A33 in b:
  print('Yes')
elif A13 and A22 and A31 in b:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
n = int(input())
if n % 2 == 0:
    print(n/2)
else:
    print((n+1)/2)
# Judge status: Wrong Answer
N = int(input()) + 1

ans_list = [[0 for i in range(10)] for j in range(10)]

for i in range(N):
    s = str(i)
    ans_list[int(s[0])][int(s[-1])] += 1

ans = 0
for i in range(0,10):
    for j in range(0,10):
        ans += ans_list[i][j]*ans_list[j][i]

print(ans)
# Judge status: Accepted
K = int(input())

k = K // 2
if K % 2 == 0:
    print(k * k)
else:
    print(k * (k+1))
# Judge status: Accepted
n,a,b=map(int,input().split())
if (b-a)%2==0:
    print((b-a)//2)
else:
    c=(a-1)+(b-a+1)//2
    d=(n-b)+(b-a+1)//2
    print(min(c,d))
# Judge status: Accepted
N = int(input())
if 1 <= N <= 999:
    print('ABC')
elif 1000 <= N <= 1998:
    print('ABD')
# Judge status: Wrong Answer
a = input()
if a:
    print("*"*len(a))
# Judge status: Accepted
s = sorted(input())
t = sorted(input())[::-1]
print("Yes" if s<t else "No")
# Judge status: Accepted
n = int(input())
if n%2 == 1:
    print(0)
else:
    i = 1
    ans = 0
    while True:
        a = n//2 // 5**i
        if a < 1:
            break
        ans += a
        i += 1
    print(ans)
# Judge status: Accepted
N,L = map(int,input().split())
apple = []
for i in range(N):
    apple.append(L+i)
if L >= 0:
    print(sum(apple)-min(apple))
else:
    if 0 <= N+L-1:
        print(sum(apple))
    else:
        print(sum(apple)+abs(N+L-1))
# Judge status: Accepted
S = input()
K = int(input())

rest = K
oz = ord('z')
oa = ord('a')
ans = list(S)

for ci in range(len(S)):
    if S[ci] == 'a':
        continue
    
    check = oz - ord(S[ci]) + 1
    if rest >= check:
        ans[ci] = 'a'
        rest -= check

if rest >= 0:
    for i in range(rest%26):
        if oz == ord(ans[-1]):
            ans[-1] = 'a'
        else:
            ans[-1] = chr(ord(ans[-1])+1)
    
print("".join(ans))
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))
x=0
y=0
c=0
for i in range(n):
    if(l[i]%4==0):
        x+=1
    elif(l[i]%2==0):
        y+=1
    else:
        c+=1
if(n%2==0):
    if(x>=c):
        print("Yes")
    else:
        print('No')
else:
    if(x>=(c-1)):
        print("Yes")
    else:
        print("No")
# Judge status: Wrong Answer
N, M, K = map(int, input().split())
if K == 0:
    print('Yes')
    exit()
flag = False
area = 0
for i in range(M):
    area += N
    if area == K:
        flag = True
area = 0
for i in range(N):
    area += M
    if area == K:
        flag = True
for i in range(1, M):
    for j in range(1, N):
        area = i * j + (N - i) * (M - j)
        if area == K:
            flag = True

if flag:
    print('Yes')
else:
    print("No")
# Judge status: Accepted
import itertools
import math

n=int(input())
lis=[i for i in range(n)]
P_lis=itertools.permutations(lis)

x=[0]*n
y=[0]*n
for i in range(n):
  x[i],y[i]=map(int,input().split())

ans=0
P=list(P_lis)
for i in range(len(P)):
  for j in range(n-1):
    ans+=math.sqrt((x[P[i][j]]-x[P[i][j+1]])**2+(y[P[i][j]]-y[P[i][j+1]])**2)
print(ans/len(P))
# Judge status: Wrong Answer
import math

n = int(input())
a = [0]*10**7
x = math.sqrt(10)
b = math.floor(x)
l = 0
for i in range(1,n+1):
  x = math.sqrt(i)
  b = math.floor(x)
  for j in range(1,b+1):
    if(i%j==0 and i//j == j):
      a[i-1] +=1
    elif(i%j==0):
      a[i-1] +=2
for k in range(n):
  l = l + a[k]*(k+1)
print(l)
# Judge status: Accepted
L=int(input())
maxL=L/3
print(maxL*maxL*maxL)
# Judge status: Wrong Answer
a, b = map(int, input().split())

price_8 = -int(-a/0.08)
price_10 = -int(-b/0.1)

print(price_10) if price_10==price_8 else print(-1)
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())

d = max(a,b)

e = c // d
mod = c % d
if mod == 0:
    print(e)
elif mod != 0:
    print(int(e) + int(1))
# Judge status: Wrong Answer
N = int(input())
pre = int(input())
ans = 0
for _ in range(N - 1):
    i = int(input())
    if pre <= i:
        ans += pre
        pre = i - pre
    else:
        ans += i + (pre - i) // 2             
        pre = 0

print(ans + pre // 2)
# Judge status: Wrong Answer
N,K=map(int,input().split())

#S = [[0 for j in range(3)] for i in range(2)]　2行3列の場合
S = [[0 for j in range(2)] for i in range(100001)]

for i in range(N):
    T=list(map(int,input().split()))
    S[T[0]][0]=T[0]
    S[T[0]][1]+=T[1]

#print(S)

for i in range(N+1):
    if S[i][0]!=0:
        K-=S[i][1]
        if K<=0:
            print(S[i][0])
            exit()
# Judge status: Accepted
n, *S = map(int, open(0).read().split())
S.sort()
ans = sum(S)
if ans % 10 == 0:
  ans -= min([s for s in S if s % 10 != 0] + [ans])
print(ans)
# Judge status: Accepted
import math
N = int(input())

def prime_decomposition(x):
  i = 2
  ls = []
  while i * i <= x:
    while x % i == 0:
      x /= i
      ls.append(i)
    i += 1
  if x > 1:
    ls.append(int(x))
  return ls

def counter(n):
  i = 1
  while n > 0.5*(i+1)*(i+2)-1:
    i += 1
  return i

cnt = 0
numbers = prime_decomposition(N)
set_number = set(numbers)

for i in set_number:
  cnt += counter(numbers.count(i))
  
print(cnt)
# Judge status: Wrong Answer
s = int(input())
lst = [0,0,1]
num = 10**9 + 7
if s>= 4:
  for i in range(4,s+1):
    lst.append(lst[i-2] + lst[i-4])
print(lst[-1]%num)
# Judge status: Accepted
N=int(input())
S=input()
ans=0
for i in range(N):
  A=len(set(S[:i+1])&set(S[i+1:]))
  ans=max(A,ans)
print(ans)
# Judge status: Accepted
A,B,C = map(int,input().split())

ans = False
for i in range(1,100):
    if (A*i)%B == C:
        ans = True
        break

if ans == True:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
N = int(input())
alphabets = {i: chr(i + 96) for i in range(1, 26)}
alphabets[0] = 'z'

queue = []

while N > 0:
    queue.insert(0, alphabets[N % 26])
    N -= 1
    N //= 26

print(''.join(queue))
# Judge status: Wrong Answer
n=int(input())
lists=list(map(int,input().split(' ')))
 
mn=(2*10)^5+1
cnt=0
for li in lists:
  if mn>li:
    mn=li
    cnt+=1
print(cnt)
# Judge status: Accepted
N, C, K = map(int, input().split())
T = [int(input()) for _ in range(N)]

T.sort()
s = -(10**10)
cnt = 0
res = 0
for t in T:
    if s+K < t:
        res += 1
        s = t
        cnt = 0
    if cnt == C:
        res += 1
        s = t
        cnt = 0
    cnt += 1

print(res)
# Judge status: Wrong Answer
#!/usr/bin/env python3

S = list(input())
if len((set(S))) == 1 and len(S)!=1:
    print('NO')
    exit()
count = {}
count['a'] = S.count('a')
count['b'] = S.count('b')
count['c'] = S.count('c')

s = sorted(count.items(), key=lambda x:x[1])
max_c = s[2][1]
sonota = s[0][1] + s[1][1]


if count['a'] == count['b'] or count['a'] == count['c'] or count['b'] == count['c']:
    print('YES')
elif max_c == sonota:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

K,X=nm()
print('Yes' if X<=500*K else 'No')
# Judge status: Wrong Answer
s=input()
print(["Bad","Yes"][len(set(s))==2 and s.count(s[0])==2])
# Judge status: Accepted
s = input()
result = 'None'
for i in range(26):
    if chr(ord('a')+i) not in s:
        result = chr(ord('a')+i)
        break
print(result)
# Judge status: Accepted
S, T = input().split()
A, B = map(int, input().split())
U = input()
if U == S:
  A = A-1
else:
  B = B-1

print(' '.join(map(str, [A, B])))
# Judge status: Wrong Answer
n,m = map(int,input().split())
score_list = [2]*m
for i in range(m):
    score_list[i] = input().split()

wa_num = 0
ac_q = []
for i in range(m):
    if score_list[i][1] == "WA" and score_list[i][0] not in ac_q:
        wa_num = wa_num + 1
    elif score_list[i][1] == "AC" and score_list[i][0] not in ac_q:
        ac_q.append(score_list[i][0])

ac_num = len(ac_q)

print(ac_num,wa_num)
# Judge status: Wrong Answer
N=int(input())
a=list(map(int, input().split()))
A=list(set(a))
A.sort(reverse=True)
if len(A) ==1:
    c=0
else:
    c=len(A)

# print(A)
for i in range(len(A)-1):
    for j in range(i+1,len(A)):
        if A[i] % A[j] == 0:
            c-=1
            break
print(c)
# Judge status: Accepted
N = int(input())
boxes = [0] * (N + 1)
ans = tuple(n for n, digit in reversed(tuple(enumerate(map(int, input().split()), 1))) if (sum(d for d in boxes[n::n]) & 1 != digit and (boxes.__setitem__(n, 1) or 1)))
print("%d\n" % len(ans), *ans)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
monster = 0
hero = 0
for i in range(N):
    allhero = B[i] + hero
    if allhero<=A[i]:
        monster += B[i]
        hero = 0
    else:
        monster += A[i]
        hero = allhero-A[i]

if hero>0:
    monster += min(hero,A[N])
print(monster)
# Judge status: Wrong Answer
import math
import collections
import fractions
import itertools
import functools
import  operator

def solve():
    n, m = map(int, input().split())
    ball, can = [1]*n, [True]*n
    can[0] = True
    for _ in range(m):
        x, y = map(int, input().split())
        if can[x-1] == True:
            can[y-1] = True
        ball[x-1] -= 1
        ball[y-1] += 1
        if ball[x-1] == 0:
            can[x-1] = False
    print(can.count(True))
    return 0

if __name__ == "__main__":
    solve()
# Judge status: Accepted
n, k = map(int, input().split())
count = 0

while n >= k:
  n = n//k
  count += 1
  
print(count+1)
# Judge status: Accepted
sx,sy,tx,ty=map(int,input().split())

x=tx-sx
y=ty-sy
ans=[]
for i in range(y):
    ans.append("U")
for i in range(x):
    ans.append("R")
for i in range(y):
    ans.append("D")
for i in range(x+1):
    ans.append("L")
for i in range(y+1):
    ans.append("U")
for i in range(x+1):
    ans.append("R")
ans.append("D")
ans.append("R")
for i in range(y+1):
    ans.append("D")
for i in range(x+1):
    ans.append("L")
ans.append("U")
print("".join(ans))
# Judge status: Accepted

N = int(input())


num, num2,num3 = 1, 1, 1

for _ in range(N):
    num = num * 10 % 1000000007
    num2 = num2 * 9 % 1000000007
    num3 = num3 * 8 % 1000000007
print((num - num2 * 2 + num3) % 1000000007)
# Judge status: Accepted
n = int(input())
m = [9 ** i for i in range(6)]
m += [6 ** i for i in range(1, 7)]
m.sort()
dp = [float("inf") for i in range(n + 1)]
dp[0] = 0
for i in range(n):
    for j in m:
        if i + j <= n:
            dp[i + j] = min(dp[i + j], dp[i] + 1)
print(dp[-1])
# Judge status: Wrong Answer
s = input()
if s[0]=='S':
    print(0)
else:
    while 'ST' in s:
        s = s.replace('ST', '')
    print(len(s))
# Judge status: Accepted
n = int(input())
a_inputs = {int(a):i+1 for i,a in enumerate(input().split())}
print(' '.join([str(a_inputs[i]) for i in range(1,n+1)]))
# Judge status: Wrong Answer
#ABC131D
n=int(input())
l=[]
for i in range(n):
    a,b=map(int,input().split())
    l.append([a,b])
l=sorted(l,key=lambda x:x[1])
deadline=l[n-1][1]
tmp=0
for i in range(n):
    tmp+=l[i][0]
if tmp<=deadline:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
s = set(input())
print("Yes") if len(s) == 2 else print("No")
# Judge status: Wrong Answer
k = int(input())
t = 7
t %= k

for i in range(1, k):
  if t == 0:
    print(i)
    exit()
  t = (t * 10 + 7) % k

print(-1)
# Judge status: Accepted
import numpy as np
h, N = map(int,input().split())
VW = [[int(x) for x in input().split()] for _ in range(N)]
VW = np.array(sorted(VW, key=lambda x:(x[0]/x[1],x[0])))
a = VW[:, 0]
b = VW[:, 1]

dp = np.zeros(10**4+1, dtype=np.int)
for i in range(1, h+1):
    dp[i] = (dp[i-a]+b).min()
print(dp[h])
# Judge status: Accepted
S = list(input())
C = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
S.sort()
set(S)
for c in C:
    if c in(S):
        if c == "z":
            print('None')
        continue
    else:
        print(c)
        break
# Judge status: Accepted
import math
A,B=map(int,input().split())
X=math.sqrt(min(A,B))
L=[]
for i in range(1,int(X)+1):
	if A%i==0:
		L.append(i)
		L.append(A//i)
L=set(L)
L=sorted(L)
S=[]
for i in L:
	if B%i==0:
		S.append(i)
ans=1
for i in S:
	if i==1:continue
	count=0
	for j in range(2,int(math.sqrt(i))+1):
		if i%j==0:
			count+=1
			break
	if count==0:
		ans+=1
print(ans)
# Judge status: Wrong Answer
a = [int(i) for i in input().split()]
b = a[2]
a.sort()
if b == a[1]:
	print("Yes")
else:
	print("No")
# Judge status: Accepted
import sys
sys.setrecursionlimit(4100000)
import math
import itertools
INF = float('inf')
from heapq import heapify, heappop, heappush
import collections

def main():
    O = input()
    E = input()

    ans = ''
    for i in range(len(O)):
        ans += O[i]
        if i < len(E):
            ans += E[i]
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
a11, a12, a13 = map(int, input().split())
a21, a22, a23 = map(int, input().split())
a31, a32, a33 = map(int, input().split())
n = int(input())
b = []
for i in range(n):
    b.append(int(input()))

ans = [[a11, a12, a13], [a21, a22, a23], [a31, a32, a33],
       [a11, a21, a31], [a12, a22, a32], [a13, a23, a33],
       [a11, a22, a33], [a13, a22, a31]]

for a in ans:
    if (a[0] in b) and (a[1] in b) and (a[2] in b):
        print("Yes")
        exit()

print("No")
# Judge status: Accepted
a = int(input())
print(a * (a + 1) / 2)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

t=0
for i in a:
  t = t ^ i
ans = []
for i in a:
  ans.append(t ^ i)
print(" ".join(str(i) for i in ans))
# Judge status: Wrong Answer
lis = []
for i in range(3):
  a= list(map(int,input().split()))
  lis.append(a)
n = int(input())
for j in range(n):
  b = int(input())
  for li in lis:
    if b in li:
      li[li.index(b)]=0

for k in range(3):
  if sum(lis[k][:])==0:
    print('Yes')
    exit(0)

for k in range(3):
  if sum(lis[:][k])==0:
    print('Yes')
    exit(0)

if (lis[0][0]+lis[1][1]+lis[2][2]==0)or(lis[2][0]+lis[1][1]+lis[0][2]==0): 
    print('Yes')
    exit(0)
    
print('No')
# Judge status: Accepted
S = input()
ACGT = ["A", "C", "G", "T"]
s = ""
l = []

for i in S:
    if i in ACGT:
        s += i
        l.append(s)
    else:
        l.append(s)
        s = ""

l2 = map(len, l)
print(max(l2))
# Judge status: Wrong Answer
n, d = map(int, input().split())
res = 0
for i in range(n):
  x, y = map(int, input().split())
  if x ** 2 + y ** 2 <= d:
    res += 1
print(res)
# Judge status: Wrong Answer
n,l=map(int, input().split())
t=0
c=0
for i in range(n):
  if i==0:
    t=abs(l+(i+1)-1)
    c=0
  else:
    t=min(t, abs(l+(i+1)-1))
    if t==abs(l+(i+1)-1):
      c=i+1
g=0
for i in range(n):
  g+=(l+(i+1)-1)
print(g-l-c)
# Judge status: Accepted
N = int(input())
A_1 = list(map(int, input().split()))
A_2 = list(map(int, input().split()))
ans = 0
for i in range(N):
    S = sum(A_1[0:i+1]) + sum(A_2[i:N])
    if S > ans:
        ans = S
 
print(ans)
# Judge status: Accepted
import math

a, b, x = map(int, input().split(" "))

cap = a * a * b

h = (x / cap) * b
if h / b >= 0.5:
    gap = b - h
    print(math.degrees(math.atan((gap / (a / 2)))))
else:
    vol = h * a
    gap = (vol / b) * 2
    print(math.degrees(math.atan(b / gap)))
# Judge status: Wrong Answer
x,y=map(int,input().split())
count=1
while x*2<y:
  count+=1
  x*=2
print(count)
# Judge status: Wrong Answer
X = int(input())
A = 0
B = 0
answer = 0
while answer != X:
    answer = A ** 5 - B ** 5
    if answer < X:
        A += 1
    if answer > X:
        B -= 1
        A -= 1
    print(A,B,answer)
# Judge status: Accepted
import sys
import math
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

N = I()
flag = 0
for i in range(1,N+1):
    if math.floor(i*1.08) == N:
        print(i)
        flag = 1
        break

if flag == 0:
    print(":(")
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
ans = 1
up = down = False
for i in range(n-1):
    if a[i] < a[i+1]:
        if up:continue
        up = True
        if down:
            ans+=1
            up = down = False
    elif a[i] > a[i+1]:
        if down:continue
        down = True
        if up:
            ans+=1
            up = down = False
print(ans)
# Judge status: Accepted
#coding:utf-8

n = int(input())

a = input().split()

count = 0

r = [(n - int(m)) for n,m in enumerate(a)]
l = [(n + int(m)) for n,m in enumerate(a)]

r.remove(r[0])
l.remove(l[-1])

mar = max(r)
mir = min(r)
mal = max(l)
mil = min(l)

R = {}
L = {}

for n,m in zip(r,l):
    R[n] = 0
    L[m] = 0

for n,m in zip(r,l):
    R[n] += 1
    L[m] += 1

for i in R.keys():
    if i in L.keys():
        count += R[i] * L[i]

print("{}".format(count))
# Judge status: Wrong Answer
Count = 0
Array = []
for i in range(int(input())):
    Dice_1, Dice_2 = map(int, input().split())
    if Dice_1 == Dice_2:
        Array.append(1)
    else:
        Array.append(0)

ans = []
j_1 = 0
for j in range(len(Array)):
    if j_1 == 1 and Array[j] == 1:
        Count = Count + 1
    else:
        Count = 0
    j_1 = Array[j]
    print(Count)
    ans.append(Count)
print(max(ans))
if max(ans) >= 2:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
N, K = map(int, input().split())
R, S, P = list(map(int, input().split()))
T = list(input())

result = [0] * N
for i,t in enumerate(T):
    if t == "r":
        result[i] = P
    elif t == "s":
        result[i] = R
    else:
        result[i] = S

if N<K:
  print(sum(result))
  exit()
for i in range(K, N):
    if result[i] == result[i-K]:
        result[i] = 0

print(sum(result))
# Judge status: Accepted
n, a, b = map(int,input().split())

if (max(a,b)- min(a,b))%2 ==0:
  print(abs(a-b)//2)
  exit()
  
distance = min(n-a + n -b, a-1+b-1)
print((distance +1)//2)