peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
t = input()

s = t.replace("?", "D")

print(s, end="")
# Judge status: Accepted
from collections import Counter
n = int(input())
c = Counter(map(int, input().split()))

L = R = 0
for k, v in c.items():
    if 4 <= v:
        L = max(L, k)
        R = max(R, k)
    elif 2 <= v:
        if R < L:
            L, R = R, L
        L = max(L, k)

print(L*R)
# Judge status: Wrong Answer
n, *a = map(int, open(0).read().split())
m = 0
for i in range(n+1):
  m = max(m, sum(a[:i] + a[n+i:]))
print(m)
# Judge status: Accepted
ch = input()
v = "aeiou"
if ch in v:
  print("vowel")
else:
  print("consonant")
# Judge status: Accepted
n = int(input())

ans = ((((10 ** n) - (9 ** n)) * 2) - ((10 ** n) - (8 ** n))) % (10 ** 9 + 7) 
print(ans)
# Judge status: Accepted
def comb(n, k, mod):

    m = 1
    for i in range(n, n - k, -1):
        m = m * i % mod

    n = 1
    for i in range(1, k + 1):
        n = n * i % mod

    return (m * pow(n, mod - 2, mod) % mod)


def main():

    mod = 1000000007
    n, a, b = map(int, input().split())

    ans = pow(2, n, mod) - 1 - comb(n, a, mod) - comb(n, b, mod)
    ans = ans % mod
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
a, b = map(int, input().split())
print(b if a >= 13 else (b // 2 if 6 <= a <= 12 else 0))
# Judge status: Accepted
import sys
input = sys.stdin.readline
n,m = map(int,input().split())
jobs = {}
for _ in range(n):
  a,b = map(int,input().split())
  if a in jobs:
    jobs[a].append(b)
  else:
    jobs[a] = [b]

import heapq
cand = []
heapq.heapify(cand)

ans = 0
for i in range(1,m+1):
  if i in jobs:
    for j in jobs[i]:
      heapq.heappush(cand,-j)
  if cand:
    ans += -heapq.heappop(cand)
print(ans)
# Judge status: Accepted
a, b, x = map(int, input().split())

print(b//x-(a-1)//x)
# Judge status: Wrong Answer
N = int(input())
D = {i: [] for i in range(N)}
A = list(map(int, input().split()))
for i in range(N-1):
  D[i].append(A[i]-1)
for i in range(N):
  print(len(D[i]))
# Judge status: Accepted
N, K = map(int, input().split())

ans = min(N % K, (K - (N % K)) % K)
print(ans)
# Judge status: Accepted
import sys
import math


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()

bt = []
ans = 0

for i in range(n):
    a, b = inintm()
    bt.append([a, b])

for i in range(n)[::-1]:
    if (bt[i][0]+ans) % bt[i][1] != 0:
        ans += bt[i][1] - ((bt[i][0]+ans) % bt[i][1])

print(ans)
# Judge status: Accepted
N = int(input())
S = list(input())
INF = int(1e6)

nE = S.count("E")
nW = N - nE

lnW = 0
ans = INF

for i in S:
    if i == "W":
        nW -= 1
        ans = min(ans, nE + lnW)
        lnW += 1
    else:
        nE -= 1
        ans = min(ans, nE + lnW)

print(ans)
# Judge status: Accepted
import math

dp = [float('inf') for _ in range(200000)]
withdraw = []

N = int(input())

#引き出し可能な金額の配列にする
withdraw.append(1)

for i in range(20):
    if 100000 >= 6**i:
        withdraw.append(6**i)
    if 100000 >= 9**i:
        withdraw.append(9**i)

withdraw = sorted(list(set(withdraw)))

dp[0] = 0

for i in range(N+1):
    for j in withdraw:
        dp[i+j] = min(dp[i+j],dp[i]+1)
        
print(dp[N])
# Judge status: Wrong Answer
x, a, b = map(int, input().split())
print('A' if abs(b-x) < abs(a-x) else 'A')
# Judge status: Accepted
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    from itertools import groupby
    s = input()
    ans = 0
    prev = 0

    for k, g in groupby(s):
        l = len(list(g))
        if k == "<":
            ans += l * (l + 1) // 2
            prev = l
        else:
            ans += l * (l + 1) // 2
            ans -= min(l, prev)

    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
[N, K] = list(map(int, input().split()))
dList = []
AList = []
snuckSnack = {}
for i in range(K):
    dList.append(int(input()))
    AList.append(list(map(int, input().split())))
for i in range(1,N+1):
    snuckSnack[i] = 0
for i in dList:
    snuckSnack[i] = 1
vicCount = 0
for i in range(1,N+1):
    if snuckSnack[i] == 0:
        vicCount += 1
print(vicCount)
# Judge status: Accepted
import sys

read = sys.stdin.buffer.read


def main():
    N, *AB = map(int, read().split())
    T = [0] * N
    for i, (a, b) in enumerate(zip(AB[::2], AB[1::2])):
        T[i] = [b, a]

    T.sort()

    ok = True
    sum_a = 0
    for b, a in T:
        sum_a += a
        if sum_a > b:
            ok = False
            break

    if ok:
        print('Yes')
    else:
        print('No')

    return


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
A, B, C = map(int, input().split())
if A == B == C:
    print('No')
elif A != B and A != C:
    print('No')
else:
    print('Yes')
# Judge status: Wrong Answer
K,S = map(int,input().split())
ans = 0

for x in range(S+1):
    for y in range(S+1):
        if x+y > S:
            break
        for z in range(S+1):
            if x+y+z == S:
                ans+=1
print(ans)
# Judge status: Wrong Answer
n=int(input())
sp=[]
for i in range(n):
    a=list(map(str,input().split()))
    a.append(i+1)
    sp.append(a)

sp=sorted(sp,key=lambda x:int(x[1]),reverse=True)


for i in range(len(sp)):
    print(sp[i][2])
# Judge status: Accepted
L, R = map(int, input().split())
# R-L>=2019なら、[L,R]に2019の倍数が必ず存在する
# すなわちiやjが2019の倍数をとりうる
if R - L >= 2019:
    print(0)
else:
    ans = 2019
    for i in range(L, R + 1):  # L<=i<=R
        for j in range(i + 1, R + 1):  # i<j<=R
            ans = min(ans, i * j % 2019)
    print(ans)
# Judge status: Accepted
a,b,c,d,e=map(int,input().split())
num=60*a+b
nnum=60*c+d
print(nnum-num-e if (nnum-num)-e>0 else 0)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

sum_A = sum(A)
sum_now = 0
cost = 99999999999
for a in A:
  sum_now += a
  cost = min(cost, abs(sum_now - (sum_A - sum_now)))
print(cost)
# Judge status: Accepted
n , m = map(int,input().split())
a = list(map(int,input().split()))
ans = 0
p = sum(a)
for i in range(n):
    if a[i] >= p/(4*m):
        ans += 1

if ans >= m:
    print("Yes")
elif ans < m:
    print("No")
# Judge status: Accepted
#!/usr/bin/env python3

# from numba import njit

# input = stdin.readline

# @njit
def solve(n,a):
  checkarr = ["o" if a[i] != i+1 else "x" for i in range(n)]
  res = 0
  for i in range(n):
    if checkarr[i] == "x":
      res += 1
      checkarr[i] = "o"
      if i != n-1:
        checkarr[i+1] = "o"
  return res



def main():
  N = int(input())
  # N,M = map(int,input().split())
  a = list(map(int,input().split()))
  print(solve(N,a))
  return

if __name__ == '__main__':
  main()
# Judge status: Accepted
N=int(input())
A= list(map(int,input().split()))
ans=0
S=sum(A)
for i in range(N):
    S-=A[i]
    ans+=A[i]*S
print(ans%(10**9+7))
# Judge status: Accepted
import numpy as np
N,M = (int(x) for x in input().split(' '))
A = np.array([int(x) for x in input().split(' ')])
A = A/np.sum(A)


if len(np.where(A>=1/4/M)[0]) >= M:
	print("Yes")
else:
	print("No")
# Judge status: Accepted
N, L = map(int, input().split())
l = [x+L-1 for x in range(1, N+1)]
l_2 = list(map(abs, l))
min_index = l_2.index(min(l_2))

l[min_index] = 0
print(sum(l))
# Judge status: Wrong Answer
n,k=map(int,input().split())
S=input()
c=0
d=0
for i in range(n-1):
    if S[i]==S[i+1]:
        c+=1
    if S[i]!=S[i+1]:
        d+=1
print(c+2*k if d>k else c+2*k-1)
# Judge status: Accepted
w,h,n=map(int,input().split())
s=0
b=w
t=0
c=h

for i in range(n):
  x,y,a=map(int,input().split())
  if a==1:
    s=max(s,x)
  elif a==2:
    b=min(b,x)
  elif a==3:
    t=max(t,y)
  else:
    c=min(c,y)
if b>s and c>t:
   print((b-s)*(c-t))
else:
  print(0)
# Judge status: Accepted
def actual(s):
    is_agct = lambda string: set(string).issubset({'A', 'G', 'C', 'T'})

    N = len(s)

    answer = 0

    for i in range(N):
        for j in range(N):
            substr = s[i:j + 1]  # スライスの後半は要素数を超えてもエラーにならないことに注意

            if is_agct(substr):
                answer = max(answer, len(substr))

    return answer


s = input()
print(actual(s))
# Judge status: Accepted
def main():
    import sys
    input = sys.stdin.buffer.readline
    N = int(input())
    TXY = [[int(i) for i in input().split()] for j in range(N)]
    time = 0
    px = 0
    py = 0
    for t, x, y in TXY:
        move = abs(py-y) + abs(px - x)
        if (t-time) < move or (t - time) % 2 != move % 2:
            return print("No")
        time = t
        px = x
        py = y
    print("Yes")


if __name__ == '__main__':
    main()
# Judge status: Accepted
from collections import deque
n,m = map(int,input().split())
prefs = [{} for _ in range(n)]
cities = deque()
for i in range(m):
    p, y = map(int,input().split())
    prefs[p-1][y] = -1
    cities.append((p,y))

for p in prefs:
    years = list(p.keys())
    years.sort()
    for y in range(len(years)):
        p[years[y]] = y+1


for _ in range(m):
    p, y = cities.popleft()
    cid = prefs[p-1][y] + p * 1000000
    print("{:0=12}".format(cid))
# Judge status: Accepted
import math

a,b,x = map(int,input().split())
h = x / (a**2)

if h >= b/2:
    print(math.degrees(math.atan(2*(b-h)/a)))
else:
    print(math.degrees(math.atan(b**2/(2*a*h))))
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))
m=max(l)
l.remove(m)
if m%2!=0:
  med=(m+1)//2
else:
  med=m//2
mi=m
for ll in l:
  mi=min(mi,abs(ll-med))
if med+mi in l:
  print(m,med+mi)
else:
  print(m,med-mi)
# Judge status: Accepted
s = input()
ans = []
for c in s:
    if c == "0":
        ans.append("0")
    if c == "1":
        ans.append("1")
    if c == "B":
        if ans:
            ans.pop(-1)
        else:
            pass
print("".join(ans))
# Judge status: Accepted
n = int(input())
alist = list(map(int, input().split()))

last = alist[0]
count = 1
status = 0  # 0-start, 1-asc, 2-desc
for a in alist[1:]:
    if (status == 1 and last > a) or (status == 2 and last < a):
        count += 1
        status = 0
    elif status == 0 and last > a:
        status = 2
    elif status == 0 and last < a:
        status = 1
    last = a
print(count)
# Judge status: Wrong Answer
a,b=map(int,input().split())
n=list(map(int,input().split()))
c=sum(n)/4*b
d=[i for i in n if i>=c]
if b<=len(d):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import numpy as np

N = int(input())
arr = [list(map(int, input().split())) for _ in range(N)]
arr = np.array(arr)

if N % 2 == 1:
    a = np.sort(arr[:, 0])
    b = np.sort(arr[:, 1])
    print(b[N // 2] - a[N // 2] + 1)

else:
    a = np.sort(arr[:, 0])
    b = np.sort(arr[:, 1])
    print((b[N // 2] + b[N // 2 - 1]) - (a[N // 2 - 1] + a[N // 2]) + 1)
# Judge status: Accepted
from bisect import bisect_right

n = int(input())
a = [-int(input()) for _ in range(n)]

li = list()
for e in a:
    i = bisect_right(li, e)
    if i == len(li):
        li.append(e)
    else:
        li[i] = e

ans = len(li)
print(ans)
# Judge status: Accepted
n=int(input())
print(sum(i<=n for i in [105,135,165,189,195]))
# Judge status: Accepted
n,m,k = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

a,b = [0],[0]
for i in range(n):
  a.append(a[i]+A[i])
for i in range(m):
  b.append(b[i]+B[i])

ans,j = 0,m
for i in range(n+1):
  if a[i]>k:
    break
  while b[j]+a[i]>k:
    j -= 1
  ans = max(ans,i+j)

print(ans)
# Judge status: Accepted
import heapq
n,m=map(int,input().split())
A=list(map(int,input().split()))
H=[]
for a in A:
    heapq.heappush(H,-a)
for i in range(m):
    heapq.heappush(H,-(-heapq.heappop(H)//2))
print(-sum(H))
# Judge status: Accepted
n,k=map(int,input().split())
s=list(input())
s[k-1]=str.lower(s[k-1])
print(''.join(s))
# Judge status: Accepted
x,y,z = [int(i) for i in input().split()]
r = x+y+z
if r<=21:
  print('win')
else:
  print('bust')
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
right = [0]
A = A[::-1]
for i in range(1, N):
    if A[i] >= A[i - 1]:  right.append(right[-1] + 1)
    else:  right.append(0)
ans = max(right)
print(ans)
# Judge status: Wrong Answer
N,P = map(int,input().split())
A = list(map(int,input().split()))
n0=0
n1=0
for i in range(N):
    if A[i]%2==0:
        n0 += 1
n1 = N-n0
if P==1 and n1==0:
    print(0)
elif P==0 and n0==0 and n1==1:
    print(0)
elif P==0 and n1==0:
    print(2**n0-1)
else:
    print(2**(n1-1)*2**n0)
# Judge status: Accepted
def main():
    N, M = map(int, input().split())

    if N > M:
        N, M = M, N

    if (N, M) == (1, 1):
        print(1)
        return

    if N == 1:
        print(M - 2)
        return

    print((N - 2) * (M - 2))


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import numpy as np
A =np.array(sorted(list(map(int,input().split()))))
a = max(A)
b = a -A
print(A,a,b)
if abs(b[1]-b[0]) %2 == 0:
    print(sum(b)//2)
else :
    print(sum(b)//2 + 1)
# Judge status: Accepted
import math

a,b,c,d=map(int,input().split())


print(max(max(a,b)*max(c,d),min(a,b)*max(c,d),max(a,b)*min(c,d),min(a,b)*min(c,d)))
# Judge status: Wrong Answer
import math
a, b = list(map(int, input().split()))
c = math.gcd(a, b)
d = a * b / c
d = d // 1
print(d)
# Judge status: Accepted
n,k = list(map(int,input().split()))
s = list(input())

s[k-1] = s[k-1].lower()
print("".join(s))
# Judge status: Accepted
import copy
n = int(input())
a = [0]*n
for i in range(n):
  a[i] = int(input())
b = copy.copy(a)
b.sort(reverse=True)

for j in range(n):
  if a[j] == b[0]:
    print(b[1])
  else:
    print(b[0])
# Judge status: Wrong Answer
import math

x,y = map(int,input().split())

a = math.floor(math.log((y/x),2))

print(a+1)
# Judge status: Accepted
S = input()
S_ = set(S)
if len(S) == len(S_):
    print('yes')
else:
    print('no')
# Judge status: Wrong Answer
N, M = list(map(int, input().split()))
C = []
for n in range(N):
  A, B = list(map(int, input().split()))
  C.append([A,B])
  
C = sorted(C, key=lambda x:x[0])

S = 0
n = 0
while S <= M:
  S += C[0][1]
  n += 1
print(S)
# Judge status: Accepted
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


k = int(input())
ans = 0
for i in range(1, k + 1):
    for j in range(1, k + 1):
        tgcd = gcd(i, j)
        for k in range(1, k + 1):
            l = gcd(tgcd, k)
            ans += l

print(ans)
# Judge status: Accepted
N,K,S = map(int,input().split())

anslist = []

if S < 10**9:
    for i in range(K):
        anslist.append(S)
    for i in range(N-K):
        anslist.append(S+1)
elif S == 10**9:
    for i in range(K):
        anslist.append(S)
    for i in range(N-K):
        anslist.append(1)

ansString = [str(i) for i in anslist]

print(" ".join(ansString))
# Judge status: Wrong Answer
import heapq
def main():
    N = int(input())
    P = [int(x) for x in input().split()]
    now = []
    heapq.heapify(now)
    ans = 0
    for i in range(N):
        heapq.heappush(now,P[i])
        if heapq.heappop(now)==P[i]:
            ans += 1
        heapq.heappush(now,P[i])
    print(ans)
if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
X,N = map(int, input().split())
if N==0:
    print(X)
    exit()
else:
    p=list(map(int,input().split()))
    A=[i for i in range(100) if i not in p]

mini=200
minip=200
for i in range(N):
    if abs(p[i]-X) <=mini:
        mini= abs(p[i]-X)
        minip=p[i]
        

minimini=200
answer=200
for a in A:
    if abs(a-minip)<minimini:
        minimini=abs(a-minip)
        answer=a

print(answer)
# Judge status: Accepted
from fractions import gcd

n=int(input())
a=list(map(int,input().split()))
mod=10**9+7


lcm=1
for i in a:
 lcm=(lcm*i)//gcd(lcm,i)

'''
ans=0
mod=10**9+7
for i in a:
 ans+=lcm//i
 ans%=mod
print(ans)

'''
'''
from functools import reduce
lcm=reduce(lambda x,y :(x*y)//gcd(x,y),a)
'''

'''
ans=0
mod=10**9+7
for i in a:
 ans+=lcm//i
 ans%=mod
'''
ans=sum(lcm//i for i in a)
ans%=mod
print(ans)
# Judge status: Wrong Answer
#6484898
from bisect import bisect
N= int(input())
A = []
for i in range(N):
    t = int(input())
    A.append(t)

D = [1]*(N+1)
D[0] = -10**10
print(D)
for a in A:
    idx = bisect(D, -a)
    D[idx] = min(D[idx], -a)
    print(D)
print(bisect(D, 0)-1)
# Judge status: Wrong Answer
LI = lambda: list(map(int, input().split()))

a, b = LI()


def main():
    ans = a - 1 if a < b else a
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
a,b=map(int,input().split())
print("Yay" if abs(a-b)<=1 else ":(")
# Judge status: Accepted
N,K=map(int,input().split())
p=list(map(int,input().split()))
p.sort()
sum=0
for i in range(K):
    sum+=p[i]
print(sum)
# Judge status: Accepted
# -*- coding: utf-8 -*-
N = int(input())
A = list(map(int, input().split(' ')))
B = list(map(int, input().split(' ')))

import math
n1 = sum([max(0, a-b)  for a, b in zip(A, B)])
n2 = sum([max(0, int(math.floor((b-a)/2))) for a, b in zip(A, B)])

if n2 >= n1:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
a,b = input().split()
if len(a) + len(b) == 2:
    print(int(a) * int(b))
else:
    print(-1)
# Judge status: Accepted
import math
A,B,H,M = list(map(int,input().split(" ")))

#時針の角度
Ha = (H * 360 / 12) + (30 * M/60)
#分針の角度
Ma = M * 360 / 60
#時針と分針のなす角度
a = abs(Ha-Ma)
#aのコサイン
cosa = math.cos(math.radians(a))

ans = math.sqrt(A**2 + B**2 - 2*A*B*cosa)

print(ans)
# Judge status: Accepted
c=[]
for i in range(3):
    c.append(list(map(int,input().split())))
ab=[0,c[1][0]-c[0][0],c[2][0]-c[0][0],c[0][0],c[0][1],c[0][2]]
ans="Yes"
for i in range(3):
    if ans=="Yes":
        for j in range(3):
            if c[i][j]!=ab[i]+ab[3+j]:
                ans="No"
                break
print(ans)
# Judge status: Accepted
import math
a, b, H, M=map(int,input().strip().split())
H %= 12

short = M*6
long = (H*60+M)/2.0
dif = abs(short-long)
kakudo = min(dif,360-dif)

c = a*a + b*b - 2*a*b*(math.cos(math.radians(kakudo)))
d = math.sqrt(c)
print(d)
# Judge status: Accepted
N, M = map(int,input().split()) 
a = N*(N-1)/2+M*(M-1)/2
print(int(a))
# Judge status: Wrong Answer
O = input()
E = input()
a = ''
cnt = 0
for i in O:
    a += i
    cnt += 1
    if len(O) == cnt:
        break
    for j in E:
        a += j
        E = E.lstrip(j)
        break
print(a)
# Judge status: Wrong Answer
A = list(map(int ,input().split(' ')))
print('YES') if len(set(A))==len(A) else print('NO')
# Judge status: Accepted
n,a,b = map(int,input().split())
d = b-a
if d%2==0:
    ans=d//2
else:
    ans = min((b+a-1)//2,(2*n-a-b+1)//2)
print(ans)
# Judge status: Accepted
S = input()
S = set(S)

flg=True
for x,y in ['NS', 'SN', 'EW', 'WE']:
    if (x in S) and (y not in S):
        flg=False
        break
ans = 'Yes' if flg else 'No'
print(ans)
# Judge status: Wrong Answer
S = str(input())
year = int(S[0] + S[1])
month = int(S[2] + S[3])
if year <= 12 and year >= 1 and month >= 1 and month <= 12:
    print('AMBIGOUS')
elif year >= 1 and year <= 99 and month >= 1 and month <= 12:
    print('YYMM')
elif year >= 12 and year <= 12 and month >= 1 and month <= 99:
    print('MMYY')
else:
    print('NA')
# Judge status: Wrong Answer
N,K = map(int,input().split())
num_list=[]

kari = 0
N = N - 1
num_list.append(input().split())
num_list_3 = sorted(num_list)
while(kari != 1):
    count = 0
    N =N + 1 
    for i in range(K - 1):
        a = num_list_3[0][i]
        s = str(N).count(a)
        print(s)
        if(s != 0):
            count= count + 1
            print(count)  
    if (count == 0):
        kari = 1
print(N)
# Judge status: Accepted
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

N, T = map(int, input().split())

ans = min(map(lambda t: t[0], filter(lambda t: t[1] <= T, [list(map(int, input().split())) for _ in range(N)] + [[1 << 28, 0]])))

print(ans if ans != 1 << 28 else "TLE")
# Judge status: Accepted
x = int(input())
  
n = (x // 11) * 2
remain = x % 11

if remain > 0:
  if remain <= 6:
    n += 1
  else:
    n += 2
    
print(n)
# Judge status: Accepted
from itertools import combinations_with_replacement as cmb

n,m,q=map(int,input().split())
abcd=[]
for i in range(q):
    ll=map(int,input().split())
    ll=[ww-1 for ww in ll]
    abcd.append(ll)
ans=0
for li in cmb(range(1,m+1),n):
    kari=0
    for i in abcd:
        if li[i[1]]-li[i[0]]==i[2]+1:
            kari+=i[3]+1
    ans=max(ans,kari)

print(ans)
# Judge status: Accepted
import bisect


def LI():
    return list(map(int, input().split()))


N = int(input())
L = LI()
L.sort()
ans = 0
for i in range(N-1, 1, -1):
    for j in range(i-1, 0, -1):
        ind = bisect.bisect_right(L, L[i]-L[j])
        if ind < j:
            ans += j-ind
print(ans)
# Judge status: Wrong Answer
s = list(input())
t = list(input())

S = sorted(s)
t = sorted(t, reverse=True)

if s<t:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
X,A,B=map(int, input().split())

if A>=B:
    print("delicious")
elif B-A<=X:
    print("safe")
else:
    print("dangerous")
# Judge status: Accepted
n = int(input())
s = input()
wh = [0] * n
bl = [0] * n

w , b = 0,0
for i in range(n):
  if s[i] == '.':
    w += 1
  else:
    b += 1
  wh[i] = w
  bl[i] = b
ans = n
wtot = wh[-1]
btot = bl[-1]
for i in range(n):
  x = (wtot - wh[i]) + bl[i]
  # print (bl[i], (wtot - wh[i]))
  ans = min(ans, x)
ans = min(ans, wtot)
print (ans)
# Judge status: Accepted
n = int(input())

s = 0
a = 1
b = 1
while a*b < n:
    while a*b < n and b <= a:
        if a == b:
            s += 1
        else:
            s += 2
        b += 1
    a += 1
    b = 1
print(s)
# Judge status: Accepted
# A - One Card Poker
a,b=list(map(int,input().split()))
if a==1:
    a=14
if b==1:
    b=14

if a>b:
    print("Alice")
elif a<b:
    print("Bob")
else:
    print("Draw")
# Judge status: Accepted
x = int(input())
n = x//500
m = x%500//5
print(1000*n+5*m)
# Judge status: Wrong Answer
n, m, k = map(int, input().split())

for i in range(n + 1):
	for j in range(m + 1):
		if i * (n - j) + j *(m - i) == k:
			print("Yes")
			exit()
else:
	print("No")
# Judge status: Wrong Answer

N, M, K = map(int, input().split())

def main(N, M, K):
    for i in range(1, N+1):
        for j in range(1, M+1):
            if N * (M - j) + M * (N - i) == K:
                return True
    return False

res = main(N, M, K)

if res == True:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
import bisect

n = (int)(input())
a = sorted(list(map(int, input().split(" "))))
b = list(map(int, input().split(" ")))
c = sorted(list(map(int, input().split(" "))))

count = 0
for i in b:
  #print((a[:bisect.bisect(a, i - 1)]), i, c[bisect.bisect_left(c, i + 1):]) 
  count += len(a[:bisect.bisect(a, i - 1):])
print(count)
# Judge status: Accepted
A, B, K = map(int,input().split())
for i in range(A, min(A + K, B + 1)):
  print(i) 
for i in range(max(B - K, A) , B):
  if i + 1 >= A + K: print(i + 1)
# Judge status: Accepted
S = input()
while True:
    S = S[:-2]
    if S[:len(S)//2] == S[len(S)//2:]:
        print(len(S))
        break
# Judge status: Accepted
import math
n, x, t = map(int, input().split())
print(t * math.ceil(n / x))
# Judge status: Accepted
from collections import Counter
N = int(input())
A = list(map(int, input().split()))

P = [i + a for i, a in enumerate(A, start=1)]
Q = [j - a for j, a in enumerate(A, start=1)]

ans = 0
QC = Counter(Q)
for p in P:
    ans += QC[p]

print(ans)
# Judge status: Wrong Answer
import itertools
from fractions import gcd
 
K = int(input())
l = range(1, K+1)
ans = sum(range(1, K+1))
 
for a, b in itertools.combinations(l, 2):
    g = gcd(a, b)
    for c in l:
        if a == c or b == c:
            ans += g * 3
        else:
            ans += gcd(g, c) * 6
        
 
print(ans)
# Judge status: Accepted
s=input()
if s[-1]=='s':
  a=s
  a+='es'
else:
  a=s+'s'
print (a)
# Judge status: Wrong Answer
S = str(input())
x = len(S)
if S[0] == '1':
    while '10' in S:
        S = S.replace('10', '')
    S = S.replace('01', '')
else:
    while '01' in S:
        S = S.replace('01', '')
S = S.replace('10', '')

print(x - len(S))