peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
import itertools

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

sum=0
mod = 1000000007
for v in itertools.combinations(A, 2):
    v0 = v[0]%mod
    v1 = v[1]%mod
    sum += v0*v1%mod
print(sum)
# Judge status: Wrong Answer
def resolve():
    n, k = map(int, input().split())
    div_val = k
    i = 1
    while True:
        if n / div_val <= 1:
            print(i)
            return
        else:
            div_val *= k
            i += 1

resolve()
# Judge status: Accepted
n = int(input())
a = [0]*n
res = 0
tmp = 0
zero = False
for i in range(n):
    s = int(input())
    a[i] = s
    if s==0:
        zero = True
if not zero:
    print(sum(a)//2)
    exit()

for i in range(n):
    if a[i]!=0:
        tmp+=a[i]
    else:
        res+=tmp//2
        tmp = 0
    if i==n-1 and tmp>1:
        res+=tmp//2
print(res)
# 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] > K - a[i]:
        j -= 1
    ans = max(ans, i + j)

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

odd = [i for i in a if i % 2 == 1]
even = [i for i in a if i % 2 == 0]
ecnt = pow(2, len(even))
ocnt = pow(2, max(len(odd)-1,0))
print(0 if (len(odd )== 0 and p == 1) else ecnt * ocnt)
# Judge status: Accepted
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
import queue
import copy


#X = str(input()).split()
#a = [int(x) for x in input().split()]


NK = str(input()).split()
N = int(NK[0])
K = int(NK[1])
ans = 1

for i in range(N):
  if(N<K**i):
    ans = i
    break

if(N<=K):
  ans = 1


print(ans)
# Judge status: Accepted
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

c = [0]
d = [0]
for i in range(n):
    c.append(c[i] + a[i])
for i in range(m):
    d.append(d[i] + b[i])

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

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

sum_A = sum(A)
tot = 0
ans = float("inf")

for i in range(N - 1):
	tot += A[i]
	ans = min(ans, abs(sum_A - tot - tot))
	
print(ans)
# Judge status: Accepted
import itertools

def main():
    n,m,q = tuple([int(t)for t in input().split()])

    a = [[int(t)for t in input().split()]for _ in [0]*q]
    
    ans = []
    for lst in itertools.combinations_with_replacement(range(1,m+1),n):
        t = 0
        for a_i,b_i,c_i,d_i in a:
            t +=  d_i if lst[b_i-1]-lst[a_i-1]==c_i else 0
        ans.append(t)
    
    print(max(ans))


if __name__ == "__main__":
    main()
# Judge status: Accepted
input = list(map(int, input().split()))

a = input[0] * input[1]

if (a%2 == 0):
	print("Even")
else:
	print("Odd")
# Judge status: Accepted
n = int(input())
l = list(map(int,input().split()))
#print(l)
z = max(l)
#print(z)
if sum(l) - max(l) > max(l):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
a, b = map(int, input().split())
if a/b ==0:
  print(0)
else:
  print(1)
# Judge status: Wrong Answer
n=input()
if n in "753":
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
N = int(input())
C = {i:0 for i in range(60)}
A = input().split()
for i in range(N):
    a = bin(int(A[i]))[2:]
    n = len(a)
    for j in range(n):
        if a[j]=="1":
            C[n-1-j] += 1
cnt = 0
for i in range(20):
    if C[i]>0:
        cnt += C[i]*(N-C[i])*2**i
print(cnt)
# Judge status: Accepted
s = list(input())
n = len(s)
ans = 10**19
for i in range(1, n-1):
    a = int("".join([s[i-1], s[i], s[i+1]]))
    ans = min(abs(753-a), ans)
print(ans)
# Judge status: Wrong Answer
#coding: utf-8
import math
import heapq
import bisect
import numpy as np
from collections import Counter
#from scipy.misc import comb

A = list(map(int, input().split()))
A.sort()

ans = (A[2]-A[1]) + (A[1]-A[0])//2 + (A[1]-A[0])%2
print(ans)
# Judge status: Accepted
n,x=map(int,input().split())
a=list(map(int,input().split()))

res=0
i=0
a.sort()

while 0<x and i < n:
    if a[i] <= x:
        res+=1
    x-=a[i]
    i+=1
if 0 < x:
    print(res-1)
else:
    print(res)
# Judge status: Accepted
a, b, c = map(int, input().split())
for i in range(1, 200):
    if a*i % b == c:
        print('YES')
        exit()
print('NO')
# Judge status: Accepted
s = input()
a = []
t = ""
for i in range(len(s)):
    if i == 0:
        a.append(s[i])
    else:
        t += s[i]
        if t != a[-1]:
            a.append(t)
            t = ""
        else:
            if i == len(s) - 1:
                a[-1] += t
print(len(a))
# Judge status: Wrong Answer
a, b = map(int, input().split())

if a == 1 or b == 1:
    print(a * b - 2)
else:
    print((a - 2) * (b - 2))
# Judge status: Accepted
N,Q=map(int,input().split())
S=input()
A=[0]*N
# 累積和
for i in range(1,N):
	if S[i-1:i+1]=="AC":
		A[i]+=1
	A[i]=A[i]+A[i-1]
# [l:r)区間の総和を求める
for i in range(Q):
	l,r=map(int,input().split())
	print(A[r-1]-A[l-1])
# Judge status: Accepted
#coding:utf-8
x, y = map(int, input().split())

mod = 10**9 + 7
f = [1]
for i in range(10**6):
    f.append(f[-1] * (i+1) % mod)
    
def nCr(n, r):
    return f[n] * pow(f[r], mod-2, mod) * pow(f[n-r], mod-2, mod) % mod

def main():
    if (x + y) % 3 != 0 or (x + y) // 3 < abs(x - y):
        print(0)
        return
    
    n = (x + y) // 3
    r = n // 2 - abs(x-y) // 2
    print(nCr(n, r))
    return
    
main()
# Judge status: Accepted
def main():
    N = int(input())
    X = []
    Y = []

    for _ in range(N):
        x, y = (int(i) for i in input().split())
        X.append(x + y)
        Y.append(x - y)

    ans = max(max(X) - min(X), max(Y) - min(Y))
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
horizontals = [[int(i) for i in input().split()] for j in range(3)]
n = int(input())

for i in range(n):
    b = int(input())
    for j, k in enumerate(horizontals):
        if b in k:
            horizontals[j][k.index(b)] = 0

verticals = [[horizontals[i][j] for i in range(3)] for j in range(3)]
diagonals = [[horizontals[i][i] for i in range(3)],
            [horizontals[j][2-j] for j in range(3)]]
card = horizontals + verticals + diagonals
bingo = [0, 0, 0]
if bingo in card:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
s = int(input())
x3 = (10**9-s%10**9)%10**9
y3 = (s+x3)//10**9
print(0, 0, 10**9, 1, x3, y3)
# Judge status: Accepted
n,m = list(map(int, input().split()))
lsta = [0 for i in range(n+1)]
lstb = [0 for i in range(n+1)]

for i in range(m):
    a,b = list(map(int, input().split()))
    if a==1:
        lsta[b]=1
    if b==n:
        lstb[a]=1

for i in range(n+1):
    if lsta[i]==1 and lstb[i]==1:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")
# Judge status: Accepted
x = int(input())
cnt = []
for b in range(1, int(x**0.5)+1):
    for p in range(2, 11):
        if b**p <= x:
            cnt.append(b**p)
            
print(max(cnt))
# Judge status: Accepted
def base10toK_base(num, K):
    if num // K:
        return base10toK_base(num//K, K) + str(num % K)
    return str(num % K)

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

cnt = 0
for s, t in zip(S, T):
    if s != t:
        cnt += 1
print(cnt)
# Judge status: Wrong Answer
x,y = map(int,input().split())

for i in range(10**10):
    if y**(i+1) >= x:
        print(i+1)
        break
# Judge status: Accepted
N, X = map(int, input().split())
x_list=list(int(x)-X for x in input().split())

def gcd(a, b):
  while b:
    a, b = b, a%b
  return a

ans=0
for x in x_list:
  ans=gcd(ans, x)
print(abs(ans))
# Judge status: Wrong Answer
def resolve():
    N,M=map(int,input().split())
    if N==1 or M==1:
        print(N*M-2)
    else:
        print((N-2)*(M-2))

resolve()
# Judge status: Accepted
a,n=map(int,input().split())
b=input()
c=[]
for i in range(n):
  c.append(int(b[2*i]))
flag="F"
while flag=="F":
  k=a
  fflag="T"
  while k>=1:
    l=int(k%10)
    for i in range(n):
      if c[i]==l:
        fflag="F"
        break
    k=int(k/10)
    if fflag=="F":
      break
  if fflag=="T":
    flag="T"
  else:
    a+=1
print(a)
# Judge status: Wrong Answer
r,g,b = map(int,input().split())
print('Yes' if (10*g+b)%4==0 else 'No')
# Judge status: Accepted
_, *A = map(int, open(0).read().split())
ans = 1
is_add = False
is_minus = False
tmp = A[0]
for a in A[1:]:
  if tmp > a:
    if is_add:
      ans += 1
      is_add = False
    else:
      is_minus = True
  elif tmp < a:
    if is_minus:
      ans += 1
      is_minus = False
    else:
      is_add = True
  tmp = a
print(ans)
# Judge status: Accepted
S=str(input())
a=['SUN','MON','TUE','WED','THU','FRI','SAT']
a=['SAT','FRI','THU','WED','TUE','MON','SUN']
print(a.index(S)+1)
# Judge status: Wrong Answer
A,B=map(int,input().split())
num=1
for i in range(1,min(A,B)//2):
    if A%i==0 and B%i==0:
        num*=i
print(num)
print(int(A*B/num))
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

N = int(input())

AAA = list(map(int, input().split()))

Q = int(input())

goukei_AAA = sum(AAA)

for i in range(0, Q):
    BC = list(map(int, input().split()))
    if not BC[0] in AAA:
        print(goukei_AAA)
        pass
    else:
        AAA = [BC[1] if m == BC[0] else m for m in AAA]
        goukei_AAA = goukei_AAA + (AAA.count(BC[0]) * (BC[1] - BC[0]))
        print(goukei_AAA)
# Judge status: Accepted
from collections import deque
from bisect import bisect_left

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

d=deque()
for i in range(n):
  b=bisect_left(d,a[i])
  if b==0:
    d.appendleft(a[i])
  else:
    d[b-1]=a[i]
    
print(len(d))
# Judge status: Wrong Answer
a,b=input().split()
a=int(a)
b=int(b)
c=b/a
i=1
x=0
while i<c:
  i=2*i
  x=x+1
print(x)
# Judge status: Accepted
n = int(input())
p = list(map(int,input().split()))
ans = 0
x=10e6
for i in range(n):
    if x >= p[i]:
        ans+=1
    x=min(x,p[i])
print(ans)
# Judge status: Accepted
x,y=map(int,input().split())

if (2*y-x)%3!=0 or (2*x-y)%3!=0 or 2*x-y<0 or 2*y-x<0:
    ans=0
else:
    a=(2*y-x)//3
    b=(2*x-y)//3
    n=a+b
    ans=1
    for i in range(min(a,b)):
        ans*=(n-i)
        ans%=(10**9+7)
        ans*=pow(i+1,10**9+5,10**9+7)
print(ans%(10**9+7))
# Judge status: Accepted
N = int(input())
x = 0
y = 0
t = 0
for _ in range(N):
    ti, xi, yi = map(int, input().split())
    dist = abs(x-xi) + abs(y-yi)
    flag = False
    if dist % 2 == 0 and not t % 2 == ti % 2:
        flag = True
    elif not dist % 2 == 0 and t % 2 == ti % 2:
        flag = True
    if dist > ti - t or flag:
        print('No')
        exit()
    x = xi
    y = yi
    t = ti

print('Yes')
# Judge status: Accepted
import fractions

a,b=map(int,input().split())
print(int(a*b/fractions.gcd(a,b)))
# Judge status: Accepted
last = 0
answer = 0
dishes = []
dishes.append(int(input()))

for i in range(1,5):
	dish = int(input()) 
	dishes.append(dish)
	if dish % 10 != 0 and dishes[last] % 10 >  dish % 10:
		last = i


for i in range(5):
	if i == last:
		answer += dishes[i]
	else:
		if dishes[i] % 10 == 0:
			answer += dishes[i] 
		else:
			answer += ((dishes[i]//10)+1)*10

print(answer)
# Judge status: Wrong Answer
from heapq import heapify, heappop, heappush
N,M = map(int,input().split())
A = [[] for _ in range(M+1)]
#HQ = []
for i in range(N):
  a,b = map(int,input().split())
  if a < M:
    A[a].append(b)
#print(A)
ans = 0
L = []
for day in range(1,M+1):
  for t in A[day]:
    heappush(L,-t)
  #print(L)
  if not L:
    continue
  temp = heappop(L)
  ans += -temp
print(ans)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))

arr=sorted([a[i]-i-1 for i in range(n)])

if len(arr)%2==0:
  tmp=[arr[len(arr)//2-1],arr[len(arr)//2]]
else:
  tmp=[arr[len(arr)//2]]

ans=10**20
for b in tmp:
  ans=min(ans,sum([abs(a[i]-b-i-1) for i in range(n)]))
print(ans)
# Judge status: Accepted
n = int(input())
s = input()
t = input()

match_count = 0
for i in range(n):
    if s[i:] == t[:n-i]:
        match_count = n-i
        break
print(2*n - match_count)
# Judge status: Wrong Answer
N = int(raw_input())
A = (map(int, raw_input().split()))
A.sort(reverse=True)
ans = 0
for i, x in enumerate(A):
  if i:
    ans += A[i-1]
print ans
# Judge status: Accepted
x, y = map(int, input().split())

if 0 <= x and 0 <= y:
    if x <= y:
        res = abs(x - y)
    elif y == 0:
        res = abs(x - y) + 1
    else:
        res = abs(x - y) + 2
elif x < 0 and y <= 0:
    if x <= y:
        res = abs(x - y)
    else:
        res = abs(x - y) + 2
else:
    res = abs(abs(x) - abs(y)) + 1

print(res)
# Judge status: Wrong Answer
N = int(input())
a = list(map(int,input().split()))

a.sort()
ans = 0
for i in range(N, 2 * N):
    ans += a[i]
print(ans)
# Judge status: Accepted
N, X, Y = list(map(int, input().split()))

dist_cnt = [0]*N

for i in range(1, N):
    for j in range(i+1, N+1):
        dist = min([j-i, abs(i - X) + abs(j - Y) + 1])
        dist_cnt[dist] += 1

for i in range(1, N):
    print(dist_cnt[i])
# Judge status: Wrong Answer
sx, sy, tx, ty = list(map(int, input().split()))

dx = tx - sx
dy = ty - sy
d1 = ['L'] + ['U']*(dy+1) + ['R']*(dx+1) + ['D']*1
d2 = ['L']*dx + ['D']*dy
d3 = ['D']*1 + ['R']*(dx+1) + ['U']*(dy+1) + ['L']*1
d4 = ['U']*dy + ['R']*dx

print(''.join(d1+d2+d3+d4))
# Judge status: Accepted
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n, a, b = MI()
    d = b - a
    ans = 0
    if d%2:
        temp = min(a-1, n-b)
        ans = (d-1)//2 + temp + 1
    else:
        ans = d//2
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Accepted
s = input()

right = [0]*(len(s)+1)
for i in range(len(s)):
    if s[i] == '<':
        right[i+1] = right[i] + 1

left = [0]*(len(s)+1)
for i in range(len(s)-1, -1, -1):
    if s[i] == '>':
        left[i] = left[i+1] + 1

ans = 0
for i in range(len(s)+1):
    ans += max(right[i], left[i])

print(ans)
# Judge status: Accepted
def isstrong(s):
    n = len(s)
    if s != s[::-1]: return False
    s1 = s[0:(n - 1)//2]
    s2 = s[(n + 1) // 2:]
    #print(s1)
    #print(s2)
    if s1 != s1[::-1]: return False
    if s2 != s2[::-1]: return False
    return True

s = input()
if isstrong(s):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
from itertools import combinations_with_replacement as cwd

N, M, Q = map(int, input().split())
A = list(cwd(range(1, M + 1), N))
ABCD = []

for i in range(Q):
    a, b, c, d = map(int, input().split())
    a, b = a - 1, b - 1
    ABCD.append([a, b, c, d])

res = 0
for i in A:
    tmp = 0
    for j in ABCD:
        if i[j[1]] - i[j[0]] == j[2]:
            tmp += j[3]
    res = max(res, tmp)

print(res)
# Judge status: Wrong Answer
print(0) if input == '1' else print(1)
# Judge status: Accepted
S = input()

ret = ""
for i in S:
    if i != "B":
        ret += i
    else:
        ret = ret[:-1]

print(ret)
# Judge status: Wrong Answer
N = int(input())
list = []
for i in range(N+1):
    if i % 3 == 0 and i % 5 == 0:
        list.append(i)
    elif i % 3 == 0:
        list.append(i)
    elif i % 5 == 0:
        list.append(i)
print(sum(list))
# Judge status: Accepted
from collections import defaultdict

n=int(input())
d=[defaultdict(int) for i in range(n)]

for i in range(n):
    s=input()
    for g in range(len(s)):
        d[i][s[g]]+=1


ans=""
char=[chr(i) for i in range(97, 97+26)]

for c in char:
    MIN=10**10
    for i in range(n):
        MIN=min(d[i][c],MIN)
    ans+=c*MIN
print(ans)
# Judge status: Accepted
arr = input().split()
arr = list(map(int, arr))

if arr[0] <= 8 and arr[1] <= 8:
    print('Yay!')
else:
    print(':(')
# Judge status: Accepted
a, b, x = map(int, input().split())

B = b//x
A = (a-1)//x
print(B-A)
# Judge status: Wrong Answer
n,m=map(int,input().split())
acf,waf=[0]*n,[0]*n
ac,wa=0,0
for i in range(m):
    x,y=input().split()
    x=int(x)
    if y=='AC':
        ac+=1
        wa+=waf[x-1]
        acf[x-1]+=1
    else:
        waf[x-1]+=1
print(ac,wa)
# Judge status: Wrong Answer
N = int(input())
CSF = [list(map(int, input().split())) for _ in range(N-1)]

ans = 0
memo = {}
memoset = set()
def dfs(i, time):
    if i==N-1:
        return time
    c, s, f = CSF[i]
    if time<s:
        time = s
    if (time, i) in memoset:
        return memo[(time, i)]
    T = dfs(i+1, time+c)
    memo[(time, i)] = T
    memoset.add((time, i))
    return T

for i in range(N-1):
    print(dfs(i, 0))
print(0)
# Judge status: Wrong Answer
N = int(input())
A = []
B = []
for i in range (0,N):
	a, b = map(int, input().split())
	A.append(a)
	B.append(b)
    
A = sorted(A)
B = sorted(B)

if N%2 ==1:
	print(B[int((N+1)/2)-1]-A[int((N+1)/2)-1]+1)
else:
	print(B[int(N/2)]+A[int(N/2)]-B[int(N/2)-1]-A[int(N/2)-1]+1)
# Judge status: Accepted
a, b, c = map(int, input().split())

if a+b==c or b+c==a or a+c==b:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(200):
  for j in range(n):
    if a[j] %2 != 0:
      print(ans)
      exit()
  ans += 1
print(ans)
# Judge status: Accepted
N = int(input())
char_dict = {}
s_li = []
ans = ''
for i in range(N):
    s_li.append(input())
for s in s_li:
    for c in [chr(ord('a') + i) for i in range(26)]:
        cnt = s.count(c)
        if c not in char_dict:
            char_dict[c] = cnt
        else:
            char_dict[c] = min(cnt, char_dict[c])
for k, v in char_dict.items():
    ans += k * v
print(ans)
# Judge status: Accepted
s = input()

ans = 'Bad' if s[0] == s[1] or s[1] == s[2] or s[2] == s[3] else 'Good'
print(ans)
# Judge status: Accepted
n = int(input())
l = []
for i in range(n):
    a, b = map(int, input().split())
    l.append((a,b))
nl = sorted(l,key=lambda x: x[1])
t = 0
for a, b in nl:
    t += a
    if t > b:
        print('No')
        exit()
print('Yes')
# Judge status: Wrong Answer
A, B = list(map(int, input().split()))

print(A*B)
# Judge status: Accepted
N, K = map(int, input().split())
p = list(map(int, input().split()))

p = sorted(p)

ans = 0

for i in range(K):
  ans += p[i]
  
print(ans)
# Judge status: Accepted
def main():
    N, M = map(int, input().split())

    pairs = []
    a = 1
    for d in range(M, 0, -2):
        pairs.append((a, a + d))
        a += 1

    a = 1 + M + 1
    for d in range(M - 1, 0, -2):
        pairs.append((a, a + d))
        a += 1

    for pair in pairs:
        print(*pair)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
cnt = 0

for i in range(n):
    for j in range(len(a)):
        if(a[j] % 2 == 0):
            a[j] = a[j] //2
        else:
            quit()  
    cnt += 1
print(cnt)
# Judge status: Accepted
a, b, m = map(int, input().split())
al = list(map(int, input().split()))
bl = list(map(int, input().split()))
ansl = []
for i in range(m):
    x, y, c = map(int, input().split())
    ansl.append(al[x-1] + bl[y-1] - c)
ansl.append(min(al) + min(al))
print(min(ansl))
# Judge status: Wrong Answer
A, B, K = map(int, input().split())

k = 0
for i in range(1, 100):
  if A%i == B%i == 0:
    k += 1
    if k == K:
      print(i)
      quit()
# Judge status: Accepted
arr =list(map(int,input().split()))

b = set(arr)

print(len(b))

#if a!=b and a!=c:
    #print(3)
#elif a==b and a!=c:
    #print(2)
#elif a==c and a!=b:
    #print(2)
#elif b==c and b!=a:
    #print(2)
#else:
    #print(1)
# Judge status: Wrong Answer
#!/usr/bin/env python


def plse1(s, i):
    if i == 0:
        return s
    if s[i] > s[i - 1]:
        s = plse1(s, i - 1)
        s[i] = 0
    else:
        s[i] += 1
    return s


n = int(input())
ss = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']

s = [0] * n
while True:
    string = ''
    for i in range(n):
        string += ss[s[i]]
    print(string)
    s = plse1(s, n - 1)
    if s == [0] * n:
        break
# Judge status: Wrong Answer
N = int(input())
if N % 2 == 1:
    print(0)
    quit()
N /= 2
res = 0
while N:
    print(N)
    res += int(N / 5)
    N = int(N / 5)
print(res)
# Judge status: Accepted
import sys
def S(): return sys.stdin.readline().rstrip()


K,S = map(int,S().split())

ans = 0
for i in range(K+1):
    for j in range(K+1):
        if 0 <= S-i-j <= K:
            ans += 1

print(ans)
# Judge status: Accepted
n,*t=map(int,open(0).read().split())
r=[0]+[1]*n
for a,b in zip(t[n+1::2],t[n+2::2]):r[a]&=t[a]>t[b];r[b]&=t[b]>t[a]
print(sum(r))
# Judge status: Accepted
x=int(input())
ans=2*(x//11)
x-=11*(x//11)
if x==0:
    print(ans)
elif x<=6:
    print(ans+1)
else:
    print(ans+2)
# Judge status: Wrong Answer
# https://atcoder.jp/contests/agc021/tasks/agc021_a

n = input()
if int(n) >= int(n[0] + '9' * (len(n) - 1)):
    ans = 9 * len(n)
else:
    ans = int(n[0]) - 1 + 9 * (len(n) - 1)
print(ans)
# Judge status: Accepted
a,b,c = map(int,input().split())
k = int(input())
for i in range(k):
    if(a >= b and a >= c): a *= 2
    elif (b >= a and b >= c): b *= 2
    elif (c >= a and c >= b): c *= 2
print(a + b + c)
# Judge status: Accepted
N = int(input())
A = [int(input()) for _ in range(N)]
ans = 0
for i in range(N-1):
    ans += A[i] // 2
    if A[i] % 2 != 0:
        if 0 < A[i+1]:
            ans += 1
            A[i+1] -= 1
ans += A[N-1] // 2
print(ans)
# Judge status: Wrong Answer
D,T,S = map(int,input().split())

print("Yes" if D-T*S < 0 else "No")
# Judge status: Accepted
N, C, K = map(int,input().split())
T = []
ans = 0 #バス内の人数
num = 1 #バスの台数
for i in range(N):
    ans = int(input())
    T.append(ans)
T = sorted(T)
ans = 0
S =  T[0] + K #バスの発車時刻
for i in T:
    if i <= S and ans < C:
        ans += 1
    else:
        num += 1
        S = i + K
        ans = 1
print(num)
# Judge status: Accepted
H = int(input())
W = int(input())
N = int(input())
if H >= W:
    if N % H == 0:
        print(N // H)
    else:
        print(N // H + 1)
else:
    if N % W == 0:
        print(N // W)
    else:
        print(N // W + 1)
# Judge status: Accepted
N, K = map(int,input().split())
S = list(input())
S[K-1] = S[K-1].lower()

print(''.join(S))
# Judge status: Accepted
n, k = map(int, input().split())
x = list(map(int, input().split()))

ans = []
for i in range(n - k + 1):
    left = x[i]
    right = x[i + k - 1]
    if abs(left) > abs(right):
        ans.append(abs(right) + abs(left - right))
    else:
        ans.append(abs(left) + abs(right - left))

print(min(ans))
# Judge status: Accepted
import bisect,collections,copy,heapq,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

n = I()
cnt = 0
for i in range(1, n+1, 2):
    divcnt = 0
    for j in range(1, i+1, 2):
        if i % j == 0:
            divcnt += 1
    if divcnt == 8:
        cnt += 1
print(cnt)
# Judge status: Accepted
import numpy as np
a, b, h, m = map(int, input().split())
h_a = ((h % 12) + m / 60)*360 / 12
m_b = ((m % 60)*360/60)%360
angle = min(np.abs(h_a - m_b), 360 - np.abs(h_a - m_b))
print(np.sqrt(a**2 + b**2 - 2*a*b*np.cos(np.radians(angle))))
# Judge status: Wrong Answer
input_date_list = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
S = input()
today_date_list = ['日', '月', '火', '水', '木', '金', '土']
s1 = input_date_list.index(S)
today_date = (today_date_list[s1])
s2 = 7 - s1
print("今日は{0}曜日です。".format(today_date)+"次の日曜日は{0}日後です".format(s2))
# Judge status: Accepted
N, _ = list(map(int, input().split()))
d = set(list(input().replace(" ", "")))

for i in range(N,10*N+1):
  n = str(i)
  ns = set(list(n))
  flg = False
  for t in ns:
    if t in d:
      flg = True
      break
  if flg == False:
    print(n)
    exit()
print(0)