peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N=int(input())
x=N//4
ans="No"
for i in range(x+1):
    for j in range(101):
        if 4*i+7*j==N:
            ans="Yes"
print(ans)
# Judge status: Wrong Answer
a,b,m = map(int,input().split())
ref = list(map(int,input().split()))
ran = list(map(int,input().split()))

ans = min(ref) + min(ran)

for i in range(m):
  t = list(map(int,input().split()))
  p = t[0] 
  q = t[1]
  c = t[2]
  if (len(ref) <= p and len(ran) <= q):
    if ref[p - 1] + ran[p - 1] - c < ans:
      ans = ref[p - 1] + ran[p - 1] - c
      
print(ans)
# Judge status: Accepted
n,c,k = map(int,input().split())
t = []
for i in range(n):
  t.append(int(input()))

ans = 0
t.sort()
x = 0
p = 0
for ti in t:
  if x < ti:
    ans += 1
    p = 1
    x = ti+k
  else:
    if p < c:
      p += 1
    else:
      ans += 1
      p = 1
      x = ti+k
print(ans)
# Judge status: Accepted
import queue

n, m = [int(_) for _ in input().split(' ')]
a = [int(_) for _ in input().split(' ')]

q = queue.PriorityQueue()
for i in a:
    q.put(-i)

for _ in range(m):
    i = -(q.get())
    q.put(-(i >> 1))

answer = 0
for _ in range(n):
    answer -= q.get()

print(answer)
# Judge status: Accepted
n,m=map(int,input().split())
if(n>=10):
    print(m)
else:
    print(m+(100*(10-n)))
# Judge status: Accepted
n,h,*t=[[*map(int,t.split())]for t in open(0)]
p=[1]*n[0]
for a,b in t:x,y=h[a-1],h[b-1];p[-a]&=x>y;p[-b]&=y>x
print(sum(p))
# Judge status: Wrong Answer
x = int(input())
print((x*(x+1))/2)
# Judge status: Wrong Answer
A,B,C,K=map(int,input().split())
maxC=K-(A+B)

if A >= K:
	max=A
else:
	if maxC <=0:
		max = A 
	else:
		max = A - maxC

print(max)
# Judge status: Wrong Answer
"""
author : halo2halo
date : 8, Jan, 2020
problem : ABC149

"""

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

S, T = read().split()
answer = T+S
print(answer)
# Judge status: Wrong Answer
O=input()
E=input()
ans=""
for i in range(len(O)):
  try:
    ans+=O[i]+E[i]
  except:
    pass
print(ans)
# Judge status: Accepted
import collections

N, X, Y = [int(x) for x in input().split()]

c = collections.Counter()

for i in range(1, N + 1):
    for j in range(i, N + 1):
        if (i == X and j == Y) or (i == Y and j == X):
            c[1] += 1
        else:
            c[min([j - i, abs(X - i) + 1 + abs(Y - j), abs(X - j) + 1 + abs(Y - i)])] += 1

for i in range(1, N):
    print(c[i])
# Judge status: Accepted
N = int(input())

MMM = map(int,input().split())
MM =list(MMM)
mini = 2020202020
list1 = []
total = 0
for i in MM:
  total+=i
  list1.append(total)
for i in list1:
  x = abs(total - 2*i)
  if mini > x:
    mini = x
print(mini)
# Judge status: Accepted
n=int(input())
v=[int(i) for i in input().split()]
ans=0
for i in range(1, len(v)-1):
    if (v[i]>v[i-1] and v[i]<v[i+1]) or (v[i]<v[i-1] and v[i]>v[i+1]):
        ans+=1
print(ans)
# Judge status: Accepted
N = int(input())
dic = {}
for i in range(N):
  s = input()
  if s not in dic:
    dic[s] = 1
  else:
    dic[s] += 1
  
M = int(input())
for i in range(M):
  t = input()
  if t not in dic:
    dic[t] = -1
  else:
    dic[t] -= 1

print(max(0,max(dic.values())))
# Judge status: Accepted
L,R=map(int,input().split())
l=L%2019
r=R%2019
#print(l,r)
if l<r and L//2019 == R//2019:
    ans=10**18
    for i in range(l,r):
        for j in range(l+1,r+1):
            if ans>(i*j)%2019:
                ans=(i*j)%2019
    print(ans)
elif L//2019<R//2019:
    print(0)
# Judge status: Accepted
s = int(input())
max_size = s//3
ans = 0
for size in range(1,max_size+1):
  a = s - 3*size
  c = size-1
  b = a+c
  b_1 = 1
  c_1 = 1
  for i in range(1,c+1):
    b_1 *= a+i
    c_1 *= i
  ans += b_1//c_1
print(ans % (10**9+7))
# Judge status: Accepted
N = int(input())
S = input()
res = 0
for i in range(N):
    S_A = set(S[:i])
    S_B = set(S[i:])
    res = max(res, len(S_A & S_B))
print(res)
# Judge status: Accepted
import sys
from io import StringIO
import unittest
import numpy as np

def resolve():
    li = sys.stdin.readlines()
    N = int(li[0].strip())
    a = list(map(int, li[1].strip().split(' ')))
    A = np.array(a[0::2])
    A = (A % 2 == 1)
    print(A.sum())
resolve()
# Judge status: Accepted
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
ans = 0
a = [None]*n
b = [None]*n

for i in range(n):
    a[i],b[i] = map(int, input().split())
for aa,bb in zip(a[::-1], b[::-1]):
    aa += ans
    ans += bb*(aa//bb + (aa%bb!=0)) - aa
#     print(ans)
print(ans)
# Judge status: Accepted
#154
s=input()
ans=""
for i in range(len(s)):
    ans+="x"
print(ans)
# Judge status: Accepted
a,b,c = map(int, input().split())

tmp = a
a = b
b = tmp

tmp = a
a = c
c = tmp

print("{} {} {}".format(a,b,c))
# Judge status: Wrong Answer
S = int(input())

A = []

while True:
    if S % 2 == 0:
        S //= 2
    else:
        S = 3*S + 1
    if not S in A:
        A.append(S)
    else:
        break

print(len(A)+2)
# Judge status: Accepted
w,a,b = map(int, input().split())

if a <= b <= a+w or b <= a <= b+w:
  print(0)
elif a < b:
  print(b-(a+w))
else:
  print(a-(b+w))
# Judge status: Wrong Answer
n = int(input())
#dp[j] = j￥を引き出すために必要な操作の最小回数
dp = [float('inf')]*(10**5+1)
dp[0] = 0
import math
for i in range(1,10**5+1):
    for j in range(int(math.log(i,9)+1)):
        dp[i] = min(dp[i], dp[i-9**j]+1)
    for k in range(int(math.log(i,6)+1)):
        dp[i] = min(dp[i],dp[i-6**k]+1)
    dp[i] = min(dp[i], dp[i-1]+1)
print(dp[n])
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split()))
#from numpy import sign
#import numpy as np
out = float('Inf')
for i in range(0, n - k + 1):
    ans = abs(a[i] - a[i + k - 1]) + min(abs(a[i]), abs(a[i + k - 1]))
    out = min(out, ans)
print(out)
# Judge status: Wrong Answer
print((lambda x:int(x[0])-max(0,100*(10-int(x[1]))))(input().split()))
# Judge status: Accepted
import collections
import sys
N=int(input())
ans=0
ANS=[]
A = list(map(int, input().split()))
new_A = sorted(A, reverse=True)
j=0
#print(new_A)
for i in range(len(A)-1):
    if new_A[j]==new_A[j+1]:
        ANS.append(new_A[j])
        #print(ANS)
        j+=1
    if len(ANS)==2:
        print(ANS[0]*ANS[1])
        sys.exit()
    j+=1
print("0")
# Judge status: Accepted
s = input()
for i in range(len(s)-1):
    if s[i]==s[i+1]:
        print('Bad')
        exit()
print('Good')
# Judge status: Accepted
from collections import deque
s = input()
q = int(input())
Q = [list(input().split()) for _ in range(q)]

ans = deque(s)
ok = True
for v in Q:
    if v[0] == "1":
        if ok: ok = False
        else: ok = True
    else:
        if v[1] == "1":
            if ok: ans.appendleft(v[2])
            else: ans.append(v[2])
        else:
            if ok: ans.append(v[2])
            else: ans.appendleft(v[2])
ans = list(ans)
if not ok: ans = ans[::-1]
print("".join(ans))
# Judge status: Accepted
def lcm(a, b):
    from math import gcd
    return a * b // gcd(a, b) 
print(lcm(360, n := int(input())) // n)
# Judge status: Accepted
a,b,c,k=map(int,input().split());print((a-b)*(-1)**k)
# Judge status: Wrong Answer
numz = input()
count = 0
numz_pair = numz.split(" ")
numz_pair = list(map(int, numz_pair))

for i in range(len(numz_pair)):
    if numz_pair[i] <= 9:
        count = count + 1
        print("True")
    else:
        print(-1)
        break

if count == len(numz_pair)+1:
    print(numz_pair[0]*numz_pair[1])
# Judge status: Wrong Answer
n = int(input())
while n < 999 :
  if list(str(n)[0]) == list(str(n)[1]) == list(str(n)[2]):
    print(n)
    exit()
  else:
    n += 1
# Judge status: Accepted
n, m = map(int, input().split())
k = sorted(list(map(int, input().split())))

if n >= m:
    print(0)
    exit()
dis = []
for i in range(m-1):
    dis.append(k[i+1] - k[i])

dis.sort()
dis.reverse()
sub = 0
#print(dis)
for i in range(n-1):
    sub += dis[i]
    
print(sum(dis) - sub)
# Judge status: Wrong Answer
N = input()

ans = int(N[0]) - 1 + 9 * (len(N) - 1)
print(ans)
# Judge status: Accepted
l,r = map(int,input().split())

if r - l >= 2040:
    print(0)
    exit(0)

res = 10 ** 100
for i in range(l, r + 1):
    for j in range(i + 1, r + 1):
        res = min(res, i * j % 2019)
print(res)
# Judge status: Wrong Answer
n = int(input())
s = input()
t = input()

cnt = 0

if s == t:
    print(n)
    exit()

s = s[::-1]

for i in range(n):
    if s[0] == t[i] and s[i] == t[0]:
        cnt += 1
    else:
        break

print(n + n-cnt)
# Judge status: Accepted
input()
a=list(map(int, input().split())) 
count=0
while all(x%2==0 for x in a):
    a=[x/2 for x in a]
    count+=1
print(count)
# Judge status: Accepted
N = int(input())
A = [0]+[int(input()) for _ in range(N)]

idx = 1
cnt = 0
for _ in range(N):
  idx = A[idx]
  cnt += 1
  if idx == 2:
    print(cnt)
    exit()
else:
  print(-1)
# Judge status: Accepted
N=int(input())
part=[list(map(int,input().split())) for _ in range(N)]

minlst=[0]*N
maxlst=[0]*N

for i in range(N):
    minlst[i]=part[i][0]
    maxlst[i]=part[i][1]
minlst.sort()
maxlst.sort()

if N%2==1:
    left=minlst[(N+1)//2-1]
    right=maxlst[(N+1)//2-1]
else:
    left=minlst[N//2-1]+minlst[N//2]
    right=maxlst[N//2-1]+maxlst[N//2]

print(right-left+1)
# Judge status: Wrong Answer
n = int(input())
p = [[0 for _ in range(10)] for _2 in range(10)]
ans = 0
for i in range(1, n+1):
  l = int(str(i)[0])
  r = int(str(i)[-1])
  p[l][r] += 1
  ans += p[r][l]
print(ans)
# Judge status: Wrong Answer
n,m = map(int, input().split())

arS = [0] * 100000
#arP = [0] * 100000

score = 0
penalty = 0
for i in range(m):
	id, res = input().split()
	id = int(id)
	if res == "AT" and arS[id]==0:
		arS[id] = 1
		score = score+1
	if res =="WA": 
#		arP[id] = arP[id] + 1
		penalty = penalty + 1
print(score, penalty)
# Judge status: Accepted
def solve(n, m):

    return (n-2 if n-2 >= 0 else 1) * (m-2 if m-2 >= 0 else 1)

if __name__ == "__main__":
    n, m = [int(i) for i in input().split()]
    print(solve(n, m))
# Judge status: Wrong Answer
text = input()
if text[1] == "S":
    if text[0] == "R" or text[2] == "R":
        print(1)
    else:
        print(0)
else:
    if text[0] == "R" and text[2] == "R":
        print(3)
    elif text[0] == "R" or text[2] == "R":
        print(2)
# Judge status: Wrong Answer
a,b = map(int, input().split())
if a+b<24: print(a+b)
elif a+b==24: print(0)
else: print((a+b)//24)
# Judge status: Wrong Answer
l=set(input())
allalphabet=[]
#print(l)
flag=1
for i in range(97,123,1):
    allalphabet.append(chr(i))
allalphabet=set(allalphabet)
sub=list(allalphabet-l)
#print(sub)
if len(sub)>0:
    print(sub[0])
else:
    print("None")
# Judge status: Wrong Answer
N,M = map(int,input().split())
l = [[] for _ in range(N+1)]
for _ in range(M):
  a,b = map(int,input().split())
  l[a].append(b)
  l[b].append(a)

ans = 'No'
st = [1]
check = [0]*(N+1)
mark = [0]*(N+1)

while st:
  s = st.pop()
  for t in l[s]:
    mark[t] = s
    check[t] = 1
    st.append(t)
  if sum(check) == N:
    ans = 'Yes'
    break

print(ans)
for i in range(2,N+1):
  print(mark[i])
# Judge status: Accepted
import sys

A, B, C, K = map(int, input().split())

S = 0

if A >= K:
    S = S + K * 1
    K = 0
    print(S)
    sys.exit()
else:
    S = S + A * 1
    K = K - A

if B >= K:
    K = 0
    print(S)
    sys.exit()
else:
    K = K - B

if C >= K:
    S = S + K * (-1)
    K = 0
    print(S)
    sys.exit()
else:
    S = S + C * 1
    print(S)
# Judge status: Accepted
n = int(input())
a_list = list(map(int, input().split()))

sorted_a = sorted(a_list)

print(sum(sorted_a[n:3*n:2]))
# Judge status: Wrong Answer
S = input()
from collections import Counter
Sc = Counter(list(S))
m = Sc.most_common()[0][1]
from sys import exit
if len(S) == 1:
    print("YES")
    exit()

try:
    if m <= sum([t[1] for t in Sc.most_common()[1:]]) and len(S) > 2:
        print("YES")
    else:
        print("NO")
except:
    print("NO")
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
i=0
if a!=b:
    i+=1
if a!=c:
    i+=1
if b!=c:
    i+=1
print(i)
# Judge status: Wrong Answer
n, a, b = map(int, input().split())

ans = 0
for x in range(1,n+1):
    print('x=='+str(x))
    sum = 0
    y = x
    while x > 0:
        sum += x%10
        x = int(x/10)
    if a<= sum <= b: 
        print(a)
        ans += y
print(ans)
# Judge status: Accepted
n = int(input())
lis = list(map(int,input().split()))
num = [0 for i in range(max(lis)+1)]
if lis[0] != 0:
    print(0)
    exit()
if lis.count(0) > 1:
    print(0)
    exit()
for nu in lis:
    num[nu] += 1
ans = 1
for i in range(max(lis)):
    if num[i] == 0:
        print(0)
        exit()
    for _ in range(num[i+1]):
        ans *= num[i]
        ans %= 998244353
print(ans%998244353)
# Judge status: Accepted
N = int(input())

A = list(map(int, input().split())) + [0]

total = 1000
stock = 0

if A[0] < A[1]:
    stock = total // A[0]
    total -= stock * A[0]

for i in range(1, N):
    if A[i] > A[i+1] and stock != 0:
        total += stock*A[i]
        stock = 0
    if A[i] < A[i+1] and stock == 0:
        stock = total//A[i]
        total -= stock*A[i]

print(total)
# Judge status: Wrong Answer
s = input().split()
i = list(map(int, input().split()))
a=input()
if a==s[0]:
  i[0]-=1
elif a==s[1]:
  i[1]-=1
print(i)
# Judge status: Accepted
import math
n,x,t=map(int,input().split())
print(math.ceil(n/x)*t)
# Judge status: Accepted
str = input().split()
s = str[0]
t = str[1]
a, b = map(int, input().split())
u = input()
 
if u == t :
  num = b - 1
  print(a, num)
else:
  num = a - 1
  print(num, b)
# Judge status: Accepted
a, b = list(map(int, input().split(' ')))
ans = 0
for i in range(2):
  if a > b:
    ans += a
    a -= 1
  else:
    ans += b
    b -= 1
print(ans)
# Judge status: Wrong Answer
n = int(input())
result = []

def hoge(currentlist, nextlist):
  temp = []
  currentlist.sort()
  nextlist.sort()
  for c in currentlist:
    for j, n in enumerate(nextlist):
      if c == n:
        temp.append(nextlist.pop(j))
        break
  return temp

for i in range(n):
  if i == 0:
    result = list(input())
    continue
  result = hoge(result, list(input()))

print(''.join(result))
# Judge status: Wrong Answer
# d
import numpy as np
n, k = [int(i) for i in input().split()]
r, s, p = [int(i) for i in input().split()]
t = np.array(list(input()))
t = np.where(t == 'r', p, t)
t = np.where(t == 's', r, t)
t = np.where(t == 'p', s, t)
t = t.astype(dtype='int64')

point = np.sum(t[:k])

for i in range(k,n):
    if t[i] != t[i-k]:
        point += t[i]
    else: # t[i] == t[i-k]:
        t[i] = 0

print(point)
# Judge status: Wrong Answer
c1 = input()
c2 = input()

if c1 == c2[:-1]:
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
h = int(input())

n = h // 2
ans = 0
for i in range(n+1):
	ans += 2**i
print(ans)
# Judge status: Wrong Answer
from sys import stdin
An, Bn, t = [int(x) for x in stdin.readline().rstrip().split()]

A = [int(x) for x in stdin.readline().rstrip().split()]
B = [int(x) for x in stdin.readline().rstrip().split()]


idxA = 0
idxB = 0

cnt = 0

for i in range(An + Bn):
	if t < 0 : break

	if An > i :
		t -= A[idxA]
		if t < 0 : break
		cnt += 1
		idxA += 1

	if Bn > i :
		t -= B[idxB]
		if t < 0 : break
		cnt += 1
		idxB += 1
print(cnt)
# Judge status: Accepted
N, M = map(int, input().split())
P = [[] for _ in range(N)]
PY = []

for _ in range(M):
    p, y = map(int, input().split())
    PY.append((p - 1, y))
    P[p - 1].append(y)
# print(P)

PD = [{} for _ in range(N)]

for i in range(N):
    for j, c in enumerate(sorted(P[i]), 1):
        PD[i][c] = j
    # print(PD)

for p, y in PY:
    print('%06d%06d' % (p + 1, PD[p][y]))
# Judge status: Accepted
x, a, b = map(int, input().split())
l_a = abs(x-a)
l_b = abs(x-b)
r = 'A' if l_a < l_b else 'B'
print(r)
# Judge status: Accepted
import sys
import math
def I(): return int(sys.stdin.readline().rstrip())

def Main():
    n,a,b,c,d,e = I(),I(),I(),I(),I(),I()
    mini = min(a,b,c,d,e)
    tn = math.ceil(n/mini)
    print(tn+4)
    return

if __name__=='__main__':
    Main()
# Judge status: Accepted
N = int(input())
questions = []
maxNum = 0
for i in range(N):
    tmp = int(input())
    questions.append(tmp)
questions.sort()
notTenLine = [i for i in questions if i % 10 != 0]
if sum(questions) % 10 != 0:
    print(sum(questions))
elif len(notTenLine) == 0:
    print(0)
else:
    print(sum(questions)-min(notTenLine))
# Judge status: Accepted
H=int(input())
W=int(input())
N=int(input())
a=max(H,W)
if N%a==0:
  print(N//a)
else:
  print(N//a+1)
# Judge status: Accepted
from operator import itemgetter
N = int(input())
A = []
B = []
for i in range(N):
  a,b = list(map(int, input().split()))
  A.append(a)
  B.append(b)

A.sort()
B.sort()

if N % 2 > 0:
  print(abs(B[(N-1) // 2] - A[(N-1) // 2]) + 1)
else:
  B1,B2 = B[N//2-1], B[N//2]
  A1,A2 = A[N//2-1], A[N//2]
  xb, xa = (B1+B2)/2, (A1+A2)/2
  print(int((xb-xa) * 2) + 1)
# Judge status: Accepted
n = int(input())
minn = 10**16
for i in range(5):
    minn = min(minn, int(input()))
print((n-1) // minn + 5)
# Judge status: Accepted
str_youbi = input()
youbi = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
youbi.reverse()
print(youbi.index(str_youbi)+1)
# Judge status: Accepted
import collections
import sys
sys.setrecursionlimit(2000000)
# import math
# import itertools
# import statistics
# import numpy as np
n = int(input())
a = list(map(int, input().split()))
ans = []
for i in range(n):
    ans.append(a[i])
    ans.append(a[i]-1)
    ans.append(a[i]+1)

ans_l = collections.Counter(ans)
print(ans_l.most_common()[0][1])
# Judge status: Wrong Answer
import math
X,Y = map(int,input().split())
'''
lengthを求めたい 
Y > max = (Y//X)*X = (2**length)*X
'''
length = math.log( Y//X ,2)
if length == 0:
  print(0)
else:  
  print(int(length//1+1))
# Judge status: Accepted
n = int(input())
t_ = input()
t_ = t_.split(" ")
t_ = list(map(int, t_))
a_d = t_[0]
t_d = t_[1]

s = input()
s = s.split(" ")
s = list(map(int, s))


ans_list = []

for v in range(n):
    ans = a_d - s[v] * 0.006 - t_d
    ans = abs(ans)
    ans_list.append(ans)
ans_ = ans_list.index(min(ans_list))

print(ans_+1)
# Judge status: Accepted
s_l = list(input())
n = len(s_l)+1
num_l = [0] * n

for i in range(n-1):
    if s_l[i] == '<':
        num_l[i+1] = num_l[i] + 1

for j in range(n-1):
    if s_l[n-2-j] == '>':
        num_l[n-2-j] = max(num_l[n-2-j], num_l[n-2-j+1]+1)

total = 0
for k in num_l:
    total += k

print(total)
# Judge status: Accepted
def gcd(a, b):
	"""Compute the greatest common divisor of a and b"""
	while b > 0:
		a, b = b, a % b
	return a

def lcm(a, b):
	"""Compute the lowest common multiple of a and b"""
	return a * b // gcd(a, b)

def resolve():
	n = int(input())
	T = []
	for _ in range(n):
		T.append(int(input()))
	ans = 1
	for i in range(n):
		ans = lcm(ans, T[i])
	print(int(ans))
resolve()
# Judge status: Accepted
A,B=map(int,input().split())

import math
print(math.ceil((B-1)/(A-1)))
# Judge status: Accepted
n = int(input())
a = sorted(list(map(int, input().split())))

m = a[-1]
r = min(a, key = lambda x: abs((m-x)-x))
print(m, r)
# Judge status: Accepted
w, a, b = map(int, input().split())
print(max(0, abs(b - a) - w))
# Judge status: Accepted
n,m=map(int,input().split())
a = list(map(int, input().split()))
print(max(-1, n-sum(a)))
# Judge status: Accepted
N = input()

if N[-1] == "3":
    print("bon")
elif N[-1] in ["0","1","6","8"]:
    print("pon")
else:
  	print("hon")
# Judge status: Wrong Answer
from sys import setrecursionlimit, exit
setrecursionlimit(1000000000)

from heapq import heapify, heappush, heappop, heappushpop, heapreplace

n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = [r if i == 's' else s if i == 'p' else p for i in list(input())]
ans = 0
for i in range(k):
    j = i
    prev = False
    while j < n:
        if prev == False or t[j] != t[j-k]:
            prev = True
            ans += t[j]
        else:
            prev = False
        j += k
print(ans)
# Judge status: Accepted
n,a,b = map(int,input().split())

minimum = a*(n-1) + b
maximum = b*(n-1) + a

ans = maximum-minimum+1

if a > b or (n == 1 and a != b):
    print(0)
else:
    print(ans)
# Judge status: Accepted
n = int(input())
d_1 = []
d_2 = []

for i in range(n):
        a = list(map(int, input().split()))
        d_1.append(a[0])
        d_2.append(a[1])

for i in range(n-2):
        if d_1[i] == d_2[i] and d_1[i+1] == d_2[i+1] and d_1[i+2] == d_2[i+2]:
                print("Yes")
                exit()

print("No")
# Judge status: Accepted
N, M = map(int, input().split())

edges = {i : [] for i in range(1, N+1)}
visited = [False for _ in range(N+1)]

for _ in range(M):
  a, b = map(int, input().split())
  edges[a].append(b)
  edges[b].append(a)

def dfs(n, count):
  # 定期便2つでは行けない
  if count == 3:
    return False
  if n == N:
    return True
  visited[n] = True
  
  for edge in edges[n]:
    if visited[edge]:
      continue
    if dfs(edge, count + 1):
      return True
  
  return False

print("POSSIBLE" if dfs(1, 0) else "IMPOSSIBLE")
# Judge status: Accepted
from collections import defaultdict
d = defaultdict(int)

N = int(input())
li = list(map(int, input().split()))

for i in li:
  d[i] += 1
  
ans = 0  

for i in d:
  if d[i] > i:
    ans += d[i] - i
    
  if d[i] < i:
    ans += d[i]
    
print(ans)
# Judge status: Wrong Answer
n = int(input())
h = list(map(int,input().split()))
h.append(float("inf"))
count = 0
flag = [0]*(n+1)
for i in range(1,n+1):
  if h[i-1] >= h[i]:
    flag[i-1] = 1

for i in range(n):
  if flag[i] == 1 and flag[i+1] != 1:
    flag[i] = flag[i-1] + 1


print(max(flag))
# Judge status: Accepted
from collections import deque
s = deque(input())
q = int(input())
rev = False
for _ in range(q):
    que = input()
    if que == "1":
        rev = not rev
    else:
        f,c = que[2:].split()
        if (f == "1") ^ rev:
            s.appendleft(c)
        else:
            s.append(c)

if rev: s.reverse()

print("".join(s))
# Judge status: Wrong Answer
A, B = map(int, input().split())
if A>=13:
    print(B)
elif B >=6:
    print(B//2)
else:
    print(0)
# Judge status: Accepted
N, K = map(int, input().split())
S = list(input())

S[K - 1] = S[K - 1].lower()
print("".join(S))
# Judge status: Wrong Answer
S=input()
l=['A','C','G','T']
cnt=0
for s in S:
    if s in l: cnt+=1
print(cnt)
# Judge status: Accepted
from functools import reduce
N = int(input())
v = list(map(int,input().split()))
v.sort()
print(reduce(lambda a,b : (a+b)/2,v))
# Judge status: Accepted
import numpy as np
w,h,n=map(int,input().split())
li=[list(map(int,input().split())) for i in range(n)]
#[[x1,y1,a1],[x2,y2,a2]]
a=np.zeros((h,w))

for i in range(n):
    lis=li[i]
    if lis[2]==1:
        a[:,:lis[0]]=1
    elif lis[2]==2:
        a[:,lis[0]:]=1
    elif lis[2]==3:
        a[:lis[1],:]=1
    elif lis[2]==4:
        a[lis[1]:,:]=1

print(np.count_nonzero(a==0))
# Judge status: Wrong Answer
from math import factorial, sqrt

def dist(x1, y1, x2, y2):
    return sqrt((x1 - x2)**2 + (y1 - y2)**2)


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

ans = 0
count = factorial(N) / (N * (N-1) / 2)

for i in range(N-1):
    for j in range(i+1, N):
        ans += dist(x[i], y[i], x[j], y[j]) * count

ans = ans / factorial(N)

print(ans)
# Judge status: Wrong Answer
s=list(input())
t=list(input())
s_len=len(s)
t_len=len(t)
for i in range(s_len-t_len+1):
    for j in range(t_len):
        if s[i+j]!="?" and t[j]!=s[i+j]:
            break
    else:
        s[i:i+t_len]=t 
        for k in range(s_len):
            if s[k]=="?":
                s[k]="a"
        print("".join(s))
        exit()
print("UNRESTABLE")
# Judge status: Wrong Answer
def main():
    a, b, c = list(map(int, input().split()))
    ans = max(int(a*10+b) + int(c), int(c+b*10) + int(a))
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Accepted
a,b,c=map(int,input().split())
print("Yes"if a+b>=c else "No")
# Judge status: Accepted
import collections
def C(n):
    return n * (n-1) // 2
N = int(input())
A = list(map(int,input().split()))
c = collections.Counter(A)
d = {}
sm = 0
for k,v in c.most_common():
    d[k] = v
    sm += C(v)
for a in A:
    print (sm - d[a] + 1)