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

a = n // 11
b = n % 11

ans = 0

if b >= 1 and b <= 6:
    ans += 1
elif b >= 7 and b <= 10:
    ans += 2

ans += a * 2 

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

if n % 2 == 1:
    print(0)
else:      
    total = 0
    d = 10
    while n >= d:
        total += (n // d)
        d *= 5

    print(total)
# Judge status: Wrong Answer
p,q,r = map(int, input().split())
ans = min(p+q,q+r,r+q)
print(ans)
# Judge status: Wrong Answer
N, M = map(int, input().split())
ans = [0] * N
ans[0] = 1
w = [1] * N
w[0] = 0

for i in range(M):
  x, y = map(int, input().split())
  if ans[x-1] == 1:
    if w[x-1] > 0:
      ans[y-1] = 1
      w[x-1] -= 1
    else:
      ans[y-1] = 1
      ans[x-1] = 0
  else:
    w[x-1] -= 1
    w[y-1] += 1
    
print(sum(ans))
# Judge status: Accepted
s = input()
n = len(s)
ans = abs(753 - int(s[0]+s[1]+s[2]))
for i in range(n-2):
  a = abs(753 - int(s[i]+s[i+1]+s[i+2]))
  ans = min(ans,a)

print(ans)
# Judge status: Wrong Answer
W,a,b =map(int,input().split())
print(b-(a+W))
# Judge status: Wrong Answer
a, b = map(int, input().split())
c = a * b
d = min(a, b)
for i in range(2, d):
    if a % i == 0 and b % i == 0:
        c //= i
        a //= i
        b //= i
print(c)
# Judge status: Wrong Answer
from math import floor
x = int(input())
k = 1
for i in range(2,x+1):
    if x % i == 0:
        k = i
        break

for a in range(floor(x ** (1/5)),x):
    b = a - k
    if a**5 - b**5 == x:
        print(a, b)
        break
# Judge status: Wrong Answer
a, b = list(map(int, input().split()))
p = (a + b) / 2 
if int(p) % 2 != 0:
    print(round(p))
else:
    if p <= int(p) + 0.5:
        print(int(p))
    else:
        print(int(p) + 1)
# Judge status: Accepted
n = int(input())-1
a = [list(map(int,input().split())) for _ in range(n)]
for i in range(n):
    t = 0
    for c,s,f in a[i:n]:
        if t<=s: t = s+c
        else:t = s+-(-(t-s)//f)*f+c
    print(t)
print(0)
# Judge status: Wrong Answer
a = input().split()
x=a[0]
y=a[1]
z=a[2]
if x==y:
    if x==z:
        print("no")
    else:
        print("yes")
else:
    if x==z:
        print("yes")
    else:
        if y==z:
            print("yes")
        else:
            print("no")
# Judge status: Accepted
#132 a
s=input()
moji=dict()
ans="No"
for c in s:
    if c not in moji:
        moji[c]=1
    else:
        moji[c]+=1
if len(moji)==2:
    ans="Yes"
print(ans)
# Judge status: Accepted
N = int(input())
a = list(map(int,input().split()))
a = sorted(a)
b = a.pop()
if sum(a) > b:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
import sys
def input():
    return sys.stdin.readline()[:-1]

def main():
    S = input()
    if "A" not in S or "B" not in S:
        print("No")
    else:
        print("Yes")

if __name__ == "__main__":
    main()
# Judge status: Accepted
a,b=map(int,input().split())
if a%3==0 or b%3==0 or (a+b)%3==0 :
    print('Possible')
else:
    print('Impossible')
# Judge status: Accepted
s="".join;*i,l=input()
for t in map(lambda x: format(x,"03b").translate(str.maketrans("01","-+")),range(8)):
 h=s(map(s,zip(i,t)))+l
 if eval(h)==7:print(h+"=7");break
# Judge status: Accepted
n,k=map(int,input().split())
left=right=ways=0
for i in range(n+1):
  left += i
  right += n-i
  if i >= k -1:
    ways += max(right -left +1, 0)
print(int(ways%(1e9+7)))
# Judge status: Accepted
n=int(input())
s=list(input())

w=s.count('W')
e=s.count('E')
r_w=w
r_e=e
l_w=0
l_e=0
ans=n

for i in range(n):
    if s[i]=='W':
        r_w-=1
        tmp=l_w+r_e
        l_w+=1
    else:
        r_e-=1
        tmp=l_w+r_e
        l_e+=1
    if tmp<ans:
        ans=tmp
print(ans)
# Judge status: Accepted
A,B,C_AB,X,Y = map(int, input().split())
if A+B >= 2*C_AB:
  print(2*C_AB*(min(X,Y)) + min(A,2*C_AB)*(X-min(X,Y)) + min(B,2*C_AB)*(Y-min(X,Y)))
else:
  print(A*X+ B*Y)
# Judge status: Accepted
import sys
A,B = [int(s) for s in input().split()]

if abs(A-B) % 2 != 0:
  print('IMPOSSIBLE')
  sys.exit()
  
print((A + B) // 2)
# Judge status: Accepted
import math
w,h=map(int, input().split())

if w == 1 or h == 1:
    print(1)
else:
    print(math.ceil(w*h/2))
# Judge status: Accepted
s=input()

if s[0] == s[1] or s[2] == s[1] or s[2] == s[3]:
    print("Bad")
else:
    print("Good")
# Judge status: Wrong Answer
n, a, b = map(int, input().split())
x = a * n - a + b
y = b * n - b + a


if b - a >= n:
    print(0)
elif a > b:
    print(0)
elif n == 1:
    print(1)
else:
    print(y - x + 1)
# Judge status: Accepted
import numpy as np
import sys

def main():
  input = sys.stdin.readline
  n = int(input())
  a = np.array([int(x) for x in input().split()])
  inf = pow(10, 9)+7
  max_a = np.max(a)
  bit = 1
  ans = 0
  num = 0
  while max_a:
    num += 1
    max_a //= 2
  for _ in range(num):
    bit_count = np.sum(a%2)
    ans += ((((bit_count%inf)*((n-bit_count)%inf))%inf)*(bit%inf))%inf
    ans %= inf
    a //= 2
    bit *= 2
  print(ans)
  
if __name__ == "__main__":
  main()
# Judge status: Accepted
# coding: utf-8
import math
n, k = map(int,input().split())
A = list(map(int,input().split()))
for i in range(n):
    if A[i]==1:
        cnt=i

l = i
r = n - i - 1
r = max(r - math.ceil(l/(k-1)) * (k-1) + l, 0)
print(math.ceil(l/(k-1)) + math.ceil(r/(k-1)))
# Judge status: Wrong Answer
n =  list(input())
N = [int(n[i]) for i in range(len(n))]
if N[0] == max(N):
  print(max(N) * 100 + max(N)*10 + max(N))
else:
  m = max(N)+1
  print(m * 100 + m * 10 + m)
# Judge status: Accepted
import heapq
n, m = map(int, input().split())
ab = [[] for _ in range(m)]
for _ in range(n):
    a, b = map(int, input().split())
    if m >= a:
        ab[a-1].append(-b)
heap = []
ans = 0
for i in range(m):
    for j in ab[i]:
        heapq.heappush(heap, j)
    if heap:
        res = heapq.heappop(heap)
        ans += -res
print(ans)
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1, n+1):
    m = n//i
    ans += i * m * (m+1) // 2

print(ans)
# Judge status: Accepted
n = input()
if "9" in n:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())
blue_words = [input() for i in range(n)]
m = int(input())
red_words = [input() for i in range(m)]

ans = 0
for w in set(blue_words):
  tmp = blue_words.count(w) - red_words.count(w)
  if tmp > ans:
    ans = tmp
      
if ans < 0:
  print(ans)
else:
  print('0')
# Judge status: Accepted
N = int(input())
T = [int(input()) for _ in range(N)]
from  fractions import gcd
ans = T[0]
for i in range(N):
    ans = (ans*T[i])//gcd(ans,T[i])
print(ans)
# Judge status: Accepted
n=int(input())
A=[[0,0] for i in range(n)]
for i in range(n):
  A[i][1],A[i][0]=map(int,input().split())
  
A.sort()
time=0
flg=True
for i in range(n):
  time+=A[i][1]
  if time>A[i][0]:
    flg=False
    
if flg:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
s=list(map(int,input()[::-1]))
t=[[0,0]for i in range(len(s)+1)]
t[0]=[0,9]
for i in range(len(s)):
    t[i+1][0]=min(t[i][0],t[i][1])+s[i]
    t[i+1][1]=min(11-s[i]+t[i][0],9-s[i]+t[i][1])
print(min(t[-1]))
# Judge status: Wrong Answer
#!/usr/bin/python
# -*- coding: UTF-8 -*-

import sys


def input():
    return sys.stdin.readline().strip()


def _main():
    s = sorted(list(input().split()))
    print("".join(s))


if __name__ == "__main__":
    _main()
# Judge status: Wrong Answer
from collections import Counter

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

counter = Counter(s)
index = 0
ans = []
for k, v in counter.most_common():
    if index == 0:
        max_v = v
        ans.append(k)
    else:
        if v == max_v:
            ans.append(k)
        else:
            exit()
    index += 1
ans = sorted(ans)
for i in range(len(ans)):
    print(ans[i])
# Judge status: Wrong Answer
n = int(input())
s = str(input())
ans = s.count("R")*s.count("G")*s.count("B")

for i in range(n-2):
    for j in range(i+1, n-1):
        k = int(2*j -i )
        if k <= n-1:
            if s[i] != s[j] and s[k] != s[i] and s[i] != s[k]:
                ans -= 1

print(ans)
# Judge status: Accepted
# 入力
a, b, c = map(int, input().split())

# 2等分できるならYes、できないならNo
if a + b == c:
    print('Yes')
elif a + c == b:
    print('Yes')
elif b + c == a:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
w=input()
count1=0
if(len(w)==1):
	count1+=0
	
for i in range(0,len(w)):
	a=w.count(w[i])
	if(a%2==0):
		count1+=1
	elif(a%2 != 0):
		count1-=1
		
if(count1>0):
	print("Yes")
elif(count1<0):
	print("No")
elif(count==0):
	print("No")
# Judge status: Accepted
s = open(0).read().split()
x = s[0][0]
s[0] = s[0][1:]
 
while True:
  p = ord(x)-97
  if len(s[p]) == 0:
    print(x.upper())
    break
  x = s[p][0]
  s[p] = s[p][1:]
# Judge status: Wrong Answer
# 日付を入力
d = int(input())

# 入力日付を基にクリスマスか等を判定
if d == 25:
    print("Christmass")
elif d == 24:
    print("Christmas Eve")
elif d == 23:
    print("Christmas Eve Eve")
elif d == 22:
    print("Christmas Eve Eve Eve")
# Judge status: Accepted
n = int(input())
d = list(map(int, input().split()))

d.sort()
print(d[n//2]-d[n//2-1])
# Judge status: Accepted
a = set(map(int,input().split()))

print(len(a))
# Judge status: Accepted
n=int(input())
ans=0
for a in range(1,n):
    ans+=(n-1)//a
print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
s = 0
def calc_mod(x):
    return x%2
def calc_div(x):
    return x/2
while list(map(calc_mod, a)).count(0) == n:
    s += 1
    a = list(map(calc_div, a))
print(s)
# Judge status: Wrong Answer
n,m = map(int,input().split())
cnt = 0
if n >= 1:
    if m // 2 >= n:
        cnt += n
        m -= n*2
    else:
        cnt += m//2
        m -= m//2
cnt += m//4

print(cnt)
# Judge status: Accepted
import math

A,B,C,X,Y=map(int,input().split())
limit=max(2*X,2*Y)

ans=float('inf')
#L=[]
for i in range(limit+1):
    temp=C*i+A*math.ceil(max(0,X-i/2))+B*math.ceil(max(0,Y-i/2))
    #L.append(temp)
    ans=min(ans,temp)

print(ans)
#print(L)
# Judge status: Wrong Answer
a,b,c,d = map(int,input().split())
ans = []
for i in c,d:
    ans.append(a*i)
for j in c,d:
    ans.append(b*i)

print(max(ans))
# Judge status: Wrong Answer
x, y, a, b, c = map(int, input().split())
arrayP = list(input().split())
arrayQ = list(input().split())
arrayR = list(input().split())
arrayP.sort(reverse=True)
arrayQ.sort(reverse=True)
arrayR.sort(reverse=True)
arrayAns = []
for i in range(x):
    arrayAns.append(int(arrayP[i]))
for i in range(y):
    arrayAns.append(int(arrayQ[i]))
arrayAns.sort()
for i in range(len(arrayR)):
    if arrayAns[0] <= int(arrayR[i]):
        arrayAns[0] = int(arrayR[i])
        arrayAns.sort()
print(sum(arrayAns))
# Judge status: Accepted
a,b,c = map(int,input().split())
print(int(b/a) if int(b/a)<c else c)
# Judge status: Accepted
import math
A, B, H, M = map(int, input().split())

wa = 360/12
wb = 360/1
t = H + M/60
theta = math.radians((wa*t)%360 - (wb*t)%360)
print(math.sqrt(A**2 + B**2 -2*A*B*math.cos(theta)))
# Judge status: Accepted
import bisect


def main():
    N = int(input())
    A = sorted(map(int, input().split()))
    B = sorted(map(int, input().split()))
    C = sorted(map(int, input().split()))

    ans = 0
    for i in range(N):
        b = B[i]
        ia = bisect.bisect_left(A, b)
        ic = bisect.bisect_right(C, b)
        # print(b, ia, ic)

        ans += (N-ic)*ia
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
import heapq
from collections import deque
N,M = map(int,input().split())
A = sorted([list(map(int,input().split())) for _ in range(N)],key=lambda x:x[0])
A = [(-A[i][1],A[i][0]) for i in range(N)]
A = deque(A)
heap = []
cnt = 0
for i in range(M-1,-1,-1):
    k = M-i
    while len(A)>0 and A[0][1]<=k:
        heapq.heappush(heap,A.popleft())
    if len(heap)>0:
        b,a = heapq.heappop(heap)
        b = -b
        cnt += b
print(cnt)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    n, q = map(int, input().split())
    s = input()

    ans = [0] * (n + 1)
    pre = ''
    sum = 0
    for i, w in enumerate(s):
        if pre == 'A' and w == 'C':
            sum += 1
        ans[i+1] = sum
        pre = w
    
    for i in range(q):
        l, r = map(int, input().split())
        print(ans[r] - ans[l])

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
tmp = list(map(int, input("input some numbers.").split()))
print(tmp[2], tmp[0], tmp[1], sep=' ')
# Judge status: Accepted
A, B, C, D = map(int, list(input()))

sym = ["+", "-"]

for op1 in range(2):
    for op2 in range(2):
        for op3 in range(2):
            S = A + B * (-1) ** op1 + C * (-1) ** op2 + D * (-1) ** op3
            if S == 7:
                print("".join(map(str, [A, sym[op1], B, sym[op2], C, sym[op3], D, "=", 7])))
                exit()
# Judge status: Wrong Answer
s = str(input())
ans = 0
if s[0] == 'A':
    for i in range(3, len(s)-1):
        if s[i] == 'C':
            ans += 1
    if ans == 1:
        print('AC')
        exit()
else:
    print('WA')
# Judge status: Wrong Answer
import math
 
def combinations_count(n, r):
    if n == 1 or n == 0:
        return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
 
if __name__ == '__main__':
    a,b=map(int,input().split())
    e_2 = combinations_count(a,2)
# Judge status: Accepted
O = input()
E = input()
psw = ""
for i in range(len(E)):
    psw = psw + O[i] + E[i]
if len(O) == len(E):
    print(psw)
else:
    print(psw+O[-1])
# Judge status: Accepted
def solve():
    ans = 0
    X = input()
    num = 0
    for x in X:
        if x=='S':
            num += 1
        else:
            if num>0:
                num -= 1
    ans = num*2
    return ans
print(solve())
# Judge status: Wrong Answer
a,b=map(int,input().split())
c=[1,3,5,7,8,10,2]
d=[4,6,9,11]
if (a in c and b in c) or (a in d and b in d):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
def main():
    K,N,*A=map(int, open(0).read().split())
    A+=[A[0]+K,A[1]+K]
    print(K-min(abs(A[i+2]-A[i]) for i in range(N)))

if __name__ == "__main__":
    main()
# Judge status: Accepted
import numpy as np
import math
A, B, H, M = map(int, input().split())

#K = int(input())
#S = input()

def yogen_teiri(A, B, ang):
    lenAB = np.sqrt(A**2 + B**2 - 2*A*B*math.cos(math.radians(ang)))
    return lenAB

angA = H*30+M*0.5
angB = M*6

if angA > angB:
    angAB = min(angA-angB, 360-(angA-angB))
    lenAB = yogen_teiri(A, B, angAB)
elif angB > angA:
    angAB = min(angB-angA, 360-(angB-angA))
    lenAB = yogen_teiri(A, B, angAB)
else:
    lenAB = np.abs(A-B)

print(lenAB)
# Judge status: Wrong Answer
S = [input().split()]
S.sort()
print(S[0])
# Judge status: Wrong Answer
n,k =list(map(int,input().split()))
a = list(map(int,input().split()))
a.sort()
ans = 0
tmp = a[0]
cnt = 1
for i in range(n):
    if tmp != a[i]:
        cnt += 1
        tmp = a[i]
    if tmp > k:
        ans = n-i
        break
print(ans)
# Judge status: Wrong Answer
N = int(input())
a = 0
ans = 0
b = 0
while N > 0:
    if N <= 10:
        ans += N - 1
        break
    if N % 10 != 9:
        b += 1
    N //= 10
    a += 1
if b == 0:
    print(a * 9)
else:
    ans += 9 * a
    print(ans)
# Judge status: Accepted
X=int(input())
i=0
while True:
    if 100*i<=X and X<=105*i:
        print(1)
        exit()
    elif 105*i<X and X<100*(i+1):
        print(0)
        exit()
    i+=1
# Judge status: Accepted
import math

X=int(input())

A=100
n=0
while X>A:
    A *= 1.01
    
    A=int(A)
    #print(A)
    n+=1
#N=int(math.log(X/100, 1.01))+1

print(n)
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))

a = sorted(a, reverse=True)
ans = 0
for i, x in enumerate(a):
    if i%2==0: ans+=x
    else: ans-=x
print(ans)
# Judge status: Accepted
S = input()
ans = 0
S = S.replace("><", ">,<").split(",")
for s in S:
  a = s.count(">")
  b = s.count("<")
  ans += a * (a - 1) // 2 + b * (b - 1) // 2 + max(a, b)
print(ans)
# Judge status: Accepted
a,b = map(int,input().split())
sa = abs(a-b)
a_true = 0
for i in range(sa-1):
    a_true += i+1
print(a_true - a)
# Judge status: Accepted
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	C
# CreatedDate:  2020-06-25 17:30:38 +0900
# LastModified: 2020-06-25 21:19:30 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


def main():
    n = int(input())
    v = list(map(int, input().split()))
    v.sort(reverse=True)
    while len(v) != 1:
        s = v.pop()
        t = v.pop()
        v.append((s+t)/2)
    print(v[0])


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
H, A = map(int, input().split())
if H%A==0:
    print(H//A+1)
else:
    print(H//A+1)
# Judge status: Accepted
import re
Sp = input().replace('?','.')
T = input()
flag = 0
for i in range(len(Sp)-len(T),-1,-1):
    if re.match(Sp[i:i+len(T)],T):
        Sp = Sp[:i]+T+Sp[i+len(T):]
        flag = 1
        break
if flag == 1:
    print(Sp.replace('.','a'))
else:
    print('UNRESTORABLE')
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
ans =[]

for _ in range(N):
  ans.append(-1)

for i in range(N,0,-1):
  C = i*2
  BALL = A[i-1]
  while C <= N:
    BALL = BALL ^ ans[C-1]
    C += i
  ans[i-1] = BALL 

print(ans.count(1))
ans2 = []
for i in range(N):
  if ans[i] == 1:
    ans2.append(i+1)

L=[str(a) for a in ans2]
L=" ".join(L)
print(L)
# Judge status: Accepted
a, b = map(int, input().split())
s = input()

flag = True
for i in range(a + b + 1):
    if i == a:
        if s[i] != "-":
            flag = False
    else:
        if not s[i].isdecimal():
            flag = False

print("Yes" if flag else "No")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
r = 0
for i in range(n):
    r += a[2*i+1]
print(r)
# Judge status: Accepted
n, a, b = map(int, input().split())

t = n//(a+b)
c=0

if t == 0 and n < a:
    c += n
    print(c)
elif t == 0 and n >= a:
    c += a
    print(c)
elif t > 0:
    c += t * a
    r = n%(a+b)
    if r == 0:
        print(c)
    elif r < a:
        c += r 
        print(c)
    elif r > a:
        c += a
        print(c)
# Judge status: Accepted
N=int(input())
P=tuple(map(int,input().split()))
Q=tuple(map(int,input().split()))
from itertools import permutations
L=list(permutations(list(range(1,N+1))))
print(abs(L.index(P)-L.index(Q)))
# Judge status: Wrong Answer
n= int(input())
a= list(map(int, input().split()))
ans=[0]*n

for i in range(31):
    x=0
    for j in range(n):
        if (a[j]>>i)&1:
            x+=1
    if x%2==0:
        for j in range(n):
            ans[j]+=((a[j]>>i)&1)*pow(2,i)
    else:
        for j in range(n):
            if (a[j]>>i)&0==0:
                ans[j]+=pow(2,i)

print(*ans)
# Judge status: Wrong Answer
Alp="abcdefghijklmnopqrstuvwxyz"
Alp[Alp.index(input())+1]
# Judge status: Accepted
from itertools import permutations
n = int(input())
p = [int(x) for x in input().split()]
q = [int(x) for x in input().split()]
lis = permutations(range(1, n + 1))
a = 0
b = 0
for i, l in enumerate(lis):
    if p == list(l):
        a = i + 1
    if q == list(l):
        b = i + 1
print(abs(a - b))
# Judge status: Accepted
cost,n = map(int,input().split())
cash = [int(x) for x in input().split()]

#account = cost - 1
flag = False
while flag == False :
    flag = True
    for i in range(len(cash)):
        if str(cash[i]) in str(cost):
            flag = False
            break
    if flag == False:
        cost += 1
    else:flag=True
        

print(cost)
# Judge status: Accepted
S = list(input())

count=0
for i in range(len(S)//2):
    if S[i] != S[len(S)-1 -i ]:
        count +=1
    else:
        continue

print(count)
# Judge status: Accepted
def main():
    x, a, b = (int(i) for i in input().split())
    cur = -a + b
    if cur <= 0:
        print("delicious")
    elif cur <= x:
        print("safe")
    else:
        print("dangerous")


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))
K = 60

bit_nums = [0 for _ in range(K)]
ans = 0
mod = 10 ** 9 + 7

for i in range(K):
    bit_nums[i] = np.sum(A >> i & 1)
    
ans = 0
for i in range(K):
    ans += (2 ** i) * (bit_nums[i] * (N - bit_nums[i]))
    ans %= mod
  
print(ans)
# Judge status: Accepted
n, m = map(int, input().split())

if n > m//2:
    print(m//2)
else:
    print(n + (m-2*n)//4)
# Judge status: Accepted
N = int(input())
L = list(map(int,input().split()))

L = sorted(L)

import bisect

# 二本を決める
ans = 0
for i in range(N - 2):
  for j in range(i + 1, N - 1):
    # L[i] + L[j] より短い棒で且つjより大きいインデックスを数える
    ind = bisect.bisect_left(L, L[i] + L[j])
    num = ind - (j + 1)
    ans += max(num, 0)
    
print(ans)
# Judge status: Accepted
n = int(input())
lst = [0]
for _ in range(n):
    lst.append(int(input()))

light = lst[1]
count = 1

while light != 2 and count < n+1:
    light = lst[light]
    count += 1

print(count if count < n+1 else -1)
# Judge status: Accepted
s=input()
cnt=0
if s[0] != 'A':
    print('WA')
    exit()
if s[2:len(s)-1].count('C') != 1:
    print('WA')
    exit()
else:
    for i in range(1,len(s)):
        if s[i]=='C':
            continue
        if s[i].isupper():
            print('WA')
            exit()

print('AC')
# Judge status: Accepted
def nCr(n, r):
    mod=10**9+7
    r = min(r, n-r)
    numer = denom = 1
    for i in range(1, r+1):
        numer = numer * (n+1-i) % mod
        denom = denom * i % mod
    return numer * pow(denom, mod-2, mod) % mod
   
n,a,b=map(int,input().split())
s=pow(2,n,10**9+7)
ans=s-1-nCr(n,a)-nCr(n,b)
while ans<0:
   ans+=10**9+7
print(ans)
# Judge status: Wrong Answer
import numpy 

n = int(input())
num = [3,5,7,11,13,17,19]
k = len(num)
ans =0
for i in range(2 ** k):
    cnt = []
    for j in range(k):
        if ((i >> j)&1):
            cnt.append(num[j])
    if numpy.prod(cnt) <= n   and len(cnt) == 3  :
        ans += 1
print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
A = list(map(int, input().split()))
for _ in range(K):
    if len(set(A)) == 1 and A[0] == N:
        break
    work = [0] * (N + 1)
    for i in range(N):
        a = A[i]
        idx0 = max(0, i - a)
        idx1 = min(N, i + a + 1)
        work[idx0] += 1
        work[idx1] -= 1
    now = 0
    for i in range(N):
        now += work[i]
        A[i] = now
print(*A)
# Judge status: Wrong Answer
n,k=map(int,input().split())
x=list(map(int,input().split()))

import bisect
c=bisect.bisect_left(x,0)
mt=2*10**8

for i in range(n-k+1):
  mt=min(mt,2*abs(x[i])+abs(x[i+k-1]),abs(x[i])+2*abs(x[i+k-1]))
  if i+k-1 ==c-1:mt=min(mt,abs(x[i]))
  if i==c:mt=min(mt,abs(x[i+k-1]))

print(mt)
# Judge status: Wrong Answer
from collections import defaultdict
 
n = int(input())
S = [input() for _ in range(n)]

d = defaultdict(lambda: -1)
for i in range(n):
    s = ''.join(sorted(list(S[i])))
    d[s] += 1
 
ans = 0
for v in d.values():
    print(v)
    ans += v*(v+1)//2
print(ans)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
print("Yes"if b-a==c-b else"No")
# Judge status: Accepted
from itertools import combinations

l, r = map(int, input().split())

ans = 2020
if r - l >= 2019:
    ans = 0
else:
    for i, j in list(combinations(range(l, r+1), 2)):
        ans = min(ans, (i*j)%2019)

print(ans)
# Judge status: Wrong Answer
S = int(input())
print(S // 10 ** 9 , 1, S % 10 ** 9, 10 **9, 0, 0)
# Judge status: Wrong Answer
num=int(input())
num2=[10, 9 ,8]

def multi(x):
	y=x**num
	return y

a, b, c=map(multi, num2)
print((a-2*b+c)%(int(1e9+7)))
# Judge status: Accepted
import math
import sys
import numpy as np

def int_input():
    return map(int, input().split())

n, k = int_input()
s = list(input())
s[k - 1] = chr(ord(s[k - 1]) + 32)
for i in range(n):
    print(s[i], end = "")
# Judge status: Accepted
A, B, C = map(int,input().split())
if A * B * C % 2 == 0: print(0)
else: print(min(A * B, B * C, A * C))
# Judge status: Accepted
# coding: utf-8
# Your code here!
K,A,B=map(int,input().split())

if B-A>2:
    if K<=A:
        print(K+1)
    else:
        K-=A-1
        
        print((B-A)*(K//2)+A+K%2)
    
    
else:
    print(K+1)