peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
n = int(input())
heights = list(map(int, input().split()))

dp = [0] * n

for i in range(n):
  act_h = heights[i]
  for j in [(i+1), (i+2)]:
    if j < n:
      next_h = heights[j]
      new_w = abs(next_h -act_h)
      if dp[j] == 0:
        dp[j] = dp[i] + new_w
      else:
        dp[j] = min(dp[i] + new_w, dp[j])

print(dp[-1])
# Judge status: Accepted
n=int(input())
l0=2
l1=1
if n>1:
    for i in range(2,n+1):
        l=l0+l1
        l0=l1
        l1=l
    print(l1)
elif n==1:
    print(1)
else:
    print(2)
# Judge status: Wrong Answer
a,b=map(int,input().split())
count=0
A=[]
B=[]
for i in range(1000):
  count+=i
  if 0<=count-a<=a:
    A.append(count-a)
  if 0<=count-b<=b:
    B.append(count-b)

for i in A:
  if i in B:
    print(i)
    break
# Judge status: Wrong Answer
l,r = map(int,input().split())

x = []

for i in range(l,r+1):
    x.append(i%2019)
    
x.sort()
    
print(x[0]*x[1]%2019)
# Judge status: Accepted
s = list(input())
cnt0 = 0
cnt1 = 0
for i, ss in enumerate(s):
    if i % 2 == 0 :
        if ss == '0':
            cnt1 += 1
        else:
            cnt0 += 1
    else:
        if ss == '1':
            cnt1 += 1
        else:
            cnt0 += 1
print(min(cnt0,cnt1))
# Judge status: Accepted
a, b = map(int, input().split())
ans = 0

for i in range(a, b+1):
    if str(i) == str(i)[::-1]:
        ans += 1

print(ans)
# Judge status: Accepted
n, k = map(int, input().split(" "))

ans = 0
for i in range(k, n+2):
    min = i * ( 0 + i-1) / 2
    max = i * ( (n+1 - i) + n) / 2
    ans += int(max - min + 1)

print(ans % (10**9 + 7))
# Judge status: Accepted
#A
a = sum(map(int, input().split()))
if a > 21:
    print('bust')
else:
    print('win')
# Judge status: Accepted
from itertools import permutations

n = int(input())

p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))

list_ = list(permutations(range(1,n+1)))
print(abs(list_.index(p)-list_.index(q)))
# Judge status: Accepted
mod = int(1e9+7)
def add(a, b):
    c = a + b
    if c >= mod:
        c -= mod
    return c

def main():
    #N, K = map(int,raw_input().split())
    n = int(raw_input())
    
    d = n % 10
    
    if d == 3:
        print('bon')
    elif d == 0 or d == 1 or d == 6 or d == 8:
        print('pon')
    else:
        print('hon')
        
    
main()
# Judge status: Wrong Answer
n=[int(str) for str in list(input())]
#print(n)
#calculate how many times you have to modify
a=len(n)



for i in range(1,a):
    if n[-i]==5 & n[-i-1]>=5:
        n[-i]=5.0000001
    if 5<n[-i] :
        n[-i]=10-n[-i]
        n[-i-1]+=1


if 6<=n[0]:
    n[0]=10-n[0]
    n.insert(0,1)



print(round(sum(n)))
# Judge status: Accepted
s = input()
a = 1<= int(s[:2]) <=12
b = 1<= int(s[2:]) <=12
if a and b:
    print("AMBIGUOUS")
elif a:
    print('MMYY')
elif b:
    print('YYMM')
else:
    print('NA')
# Judge status: Wrong Answer


# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    n = int(input())
    a = input().split()

    bob = 0
    alice = 0
    sort_a = sorted(a, reverse=True)
    count = 0
    for m in range(len(sort_a)):
        if m % 2 == 0:
            alice += int(sort_a[m])
        else:
            bob += int(sort_a[m])

    print(alice - bob)
# Judge status: Accepted
n = int(input())
h = list(map(int, input().split()))
answer = 0#これなに
m = 0#カウントするやつやね
for i in range(n-1):
    if h[i] >= h[i+1]:
        m += 1
    else:
        answer = max(answer,m)
        m = 0
answer = max(answer,m)
print(answer)
# Judge status: Wrong Answer
from sys import stdin
import fractions

n = int(stdin.readline().rstrip())
li = [[0,0]]+[list(map(int,stdin.readline().rstrip().split())) for _ in range(n)]
li = li[::-1]
count = 0
for i in range(n):
    if li[i][0]%li[i][1] != 0:
        count += -li[i][0]%li[i][1]
        li[i+1][0] += count
print(count)
# Judge status: Accepted
from collections import defaultdict
N = int(input())
S = input()
d = defaultdict(int)
for s in S:
  d[s] += 1
ans = 1
for c in d:
  ans *= (d[c] + 1)
mod = pow(10, 9) + 7
print((ans - 1) % mod)
# Judge status: Wrong Answer
k = int(input())
if k%2==0:
    print((k//2)**2)
elif k%2==1:
    print(((k-1)//2)*(k//2))
# Judge status: Accepted
import math


def is_prme_number(num):
    if num == 1:
        return False

    for i in range(2, int(math.sqrt(num)) + 1):
        if num % i == 0:
            return False

    return True


def main():
    x = int(input())
    while True:
        if is_prme_number(x):
            break
        x += 1
    print(x)


if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 5 + 10)


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


def resolve():
    n = int(input())
    A = [int(input()) for i in range(n)]

    ans = 0
    seq_cnt = 0
    for i in range(n):
        if A[i] != 0:
            seq_cnt += A[i]
        else:
            ans += seq_cnt // 2
            seq_cnt = 0
    ans += seq_cnt // 2

    print(ans)


resolve()
# Judge status: Accepted
S=input()
if S[2]==S[3]:
    if S[4]==S[5]:
        print('Yes')
    else:
        print('No')
else:
    print('No')
# Judge status: Wrong Answer
from math import factorial

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

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

ans = 0

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

ans /= factorial(N)

print(ans)
# Judge status: Accepted
n = int(input())
c = input()
s = [0]
for i in range(n):
  if c[i] == 'R':
    s.append(s[i])
  else:
    s.append(s[i] + 1)
r = n - s[n]
ans = 10**10
for i in range(n + 1):
  ans = min(ans, max(s[i], r - i + s[i]))
print(ans)
# Judge status: Accepted
n, m = list(map(int, input().split()))
if n == m == 1:
    print(1)
elif n == 1 or m == 1:
    print(n * m - 2)
else:
    print(n * m - 2 * (n + m - 2))
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split()))
print(-(-(n-1)//(k-1)))
# Judge status: Accepted
a, b = map(int, input().split())

if a>b:
    print(a-1)
else:
    print(a)
# Judge status: Accepted
n,k=map(int,input().split())
a=input()
print((n-1+k-2)//(k-1))
# Judge status: Accepted
import math


def solve():
    r = int(input())
    ans = r * 2 * math.pi
    print(ans)


if __name__ == '__main__':
    solve()
# Judge status: Accepted
import math
N,M = map(int, input().split())
l = [[int(i) for i in input().split()] for j in range(N)]

l.sort()
count = 0
i = 0
while(M > 0):
    M -= l[i][1]
    count += l[i][0]*l[i][1]
    if(M < 0):
        count -= abs(M)*l[i][0]
    i += 1
print(count)
# Judge status: Accepted
import sys
a = int(input())
s = input()

if not ( 2800 <= a < 5000 ): sys.exit()
if not ( 1 <= len(s) <= 10 ): sys.exit()
if not s.islower(): sys.exit()

print(s) if a >= 3200 else print('red')
# Judge status: Accepted
def main():
    H,W = map(int,input().split())
    N = H*W
    #print(N//2)

    if H == 1 or W == 1:
        return 1
    elif N%2 == 0:
        ans = int(N/2)
    else:
        ans = int((N//2) + 1)

    return ans

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

has_7 = '7' in str(n)

if has_7:
	print('Yes')
else:
  	print('No')
# Judge status: Accepted
N,K = map(int,input().split())
ans = []
for i in range(N):
    ab = list(map(int,input().split()))
    ans.append(ab)
ans.sort()
l = 0
for i in range(N):
    l += ans[i][1]
    if l >= K:
        s = i
        break
print(ans[s][0])
# Judge status: Accepted
n,k=map(int, input().split())
h=list(map(int, input().split()))
h.sort(reverse=True)
ans=sum(h)
if n>k:
  for i in range(k):
    ans=ans-h[i]
else:
  ans=0
print(ans)
# Judge status: Accepted
#abc173a

n=int(input())
if n%1000==0:
 print(0)
 exit()
print(1000-n%1000)
# Judge status: Wrong Answer
n,m=map(int,input().split())
for i in reversed(range(int(m**0.5)+1)):
    if m%i==0:
        if i>=n:print(m//i)
        elif m//i>=n:print(i)
        break
# Judge status: Accepted
a, b, c = map(int, input().split())
for i in range(1, b+1):
    if (a*i)%b == c:
        print("YES")
        exit(0)

print("NO")
# Judge status: Wrong Answer
n=int(input())
dp=[[0 for i in range(3)] for i in range(n)]
ans = 0
I=[0]*n
for i in range(n):
    dp[i]=list(map(int,input().split()))
    S=dp[i].copy()
    S.sort(reverse = True)
    if i == 0 or dp[i].index(S[0]) != I[i-1]:
        I[i]=dp[i].index(S[0])
        ans += S[0]
    else:
        I[i]=dp[i].index(S[1])
        ans += S[1]
print(ans)
# Judge status: Accepted
N,X = map(int,input().split())
A = list(map(int,input().split()))

ans = 0
for i in range(1,N):
    if A[i] + A[i-1] <= X: continue
    diff = A[i] + A[i-1] - X
    ans += diff
    if diff < A[i]:
        A[i] -= diff
    else:
        #diff -= A[i]
        A[i] = 0
        #A[i-1] -= diff
print(ans)
# Judge status: Wrong Answer
size = int(input())
array =  list(map(int, input().split()))
dp = [0]* size
for jump in range(1,size):
	z= [1,2]
	for i in range(len(z)):
		dp[jump] = min(dp[jump],dp[i] + dp[jump] )

print(dp[-1])
# Judge status: Accepted
l, r = map(int, input().split())
mod = 2019
ans = 1001001001
for i in range(l, min(r+1, l+2020)):
    for j in range(i+1, min(r+1, i+1+2020)):
        ans = min(ans , i*j%mod)
print(ans)
# Judge status: Wrong Answer
X = int(input())
if X > 400 and X < 599:
    print('8')
elif X > 600 and X < 799:
    print('7')
elif X > 800 and X < 999:
    print('6')
elif X > 1000 and X < 1199:
    print('5')
elif X > 1200 and X < 1399:
    print('4')
elif X > 1400 and X < 1599:
    print('3')
elif X > 1600 and X < 1799:
    print('2')
elif X > 1800 and X < 1999:
    print('1')
# Judge status: Wrong Answer
n=int(input())
a=list(map(int, input().split()))
t=0
g=0
for i in range(n):
  while a[i]%2==0:
    t+=1
    a[i]=a[i]//2
  if g==0:
    g=t
  else:
    g=min(g,t)
print(g)
# Judge status: Wrong Answer
N = int(input())
ans = 0

for i in range(N+1):
  if i % 2 != 0:
    ans += 1
  else:
    ans += 0
print("%d"%(ans))
# Judge status: Accepted
S = input()

if("A" in S and "B" in S):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
mod = 998244353


n = int(input())
D = list(map(int, input().split()))

if D[0] != 0:
    print(0)
    exit()

CNT = [0] * n
for d in D:
    CNT[d] += 1

if CNT[0] >= 2:
    print(0)
    exit()

ans = 1
for i in range(1, n):
    ans *= pow(CNT[i - 1], CNT[i], mod)
    ans %= mod

print(ans)
# Judge status: Accepted
#入力
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

#計算
if N <= K:
   result = X * N
else:
   result = (X * K) + (Y * (N - K))

#出力
print(result)
# Judge status: Accepted
N, M = map(int,input().split())
A = list(map(int,input().split()))
A.sort(reverse=True)
S = sum(A)
if A[M-1] >= S / (4*M):
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
sx, sy, tx, ty = map(int,input().split())
keiro = ""
for i in range(ty-sy):
    keiro += "U"
for i in range(tx-sx):
    keiro += "R"
keiro0 = keiro
keiro = ""
for i in range(ty-sy):
    keiro += "D"
for i in range(tx-sx):
    keiro += "L"
keiro1 = keiro

ans = keiro0+keiro1+"LU"+keiro0+"RDDR"+keiro1+"LU"

print(ans)
# Judge status: Accepted
N = int(input())
T, A = map(int, input().split())
delta = float('inf')
H = list(map(int, input().split()))
for i in range(N):
    # H = int(input())
    if delta > abs((T - H[i] * 0.006) - A):
        delta = abs((T - H[i] * 0.006) - A)
        answer = i + 1

print(answer)
# Judge status: Accepted
n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

x.sort(reverse=True)
xmax = max(x[0], X)
y.sort()
ymin = min(y[0], Y)

if ymin - xmax > 0:
    print("No War")
else:
    print("War")
# Judge status: Accepted
l=[input() for _ in range(int(input()))]
for i,w in enumerate(l):
  if i and (l[i][0]!=l[i-1][-1] or w in l[:i]): exit(print('No'))
print('Yes')
# Judge status: Accepted
n,k = list(map(int, input().split()))
a = list(map(int, input().split()))

from collections import Counter
ca = Counter(a)

# 個数が少ないものを何個削れば良いか数える
c = sorted(ca.values())
print(sum(c[:-k]))
# Judge status: Accepted
import math
H = int(input())
W = int(input())
N = int(input())
print(min(math.ceil(N / H), math.ceil(N / W)))
# Judge status: Wrong Answer
n=int(input())
l=[int(input()) for _ in range(n)]
#print(l)
k=l
k.sort()
dic_lst={}
for i in l:
  if i not in dic_lst:
    dic_lst[i]=1
  else:
    dic_lst[i]+=1
for i in l:
  max_num=max(dic_lst.keys())
  if i<max_num:
    print(max_num)
  if i==max_num:
    if dic_lst[i]>1:
      print(max_num)
    elif dic_lst[i]==1:
      print(k[1])
# Judge status: Accepted
h,a = [int(x) for x in input().split()]
n = 0
while(h>0):
	h = h - a
	n = n + 1
print(n)
# Judge status: Wrong Answer
N, M = map(int, input().split())
A = [int(i) for i in input().split()]

total = sum(A)

for i in range(len(A)):
    if (A[i] / total) < (1 / M):
        print('{}'.format('No'))
        exit()

print('{}'.format('Yes'))
# Judge status: Accepted
n = int(input())
a = [list(map(int,input().split()))for i in range(n)]
ans = 0
for i in range(n):
    for j in range(n):
        ans += ((a[i][0]-a[j][0])**2 + (a[i][1]-a[j][1])**2)**0.5
print(ans/n)
# Judge status: Accepted
# -*- coding: utf-8 -*-
import math

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

for i in range(0, 10001):
    if math.floor(0.08*i) == a:
        if math.floor(0.10*i) == b:
            print(i)
            exit()

print(-1)
# Judge status: Accepted
N, x = map(int, input().split())
A_list = list(map(int, input().split()))
A_list = sorted(A_list)
for i in range(N):
    x -= A_list[i]
    if x <= 0:
        break
print(i+1) if x == 0 else print(i)
# Judge status: Wrong Answer
w,a,b=map(int,input().split())
print(0 if w+a>=b else abs(w+a-b))
# Judge status: Accepted
n = int(input())
l = list(map(int, input().split()))

even = len([i for i in l if i % 2 == 0])
four = len([i for i in l if i % 4 == 0])
even_wo_four = even - four

if four >= n//2:
    print('Yes')
elif n - four * 2 == even_wo_four:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N = int(input())
if N==1:
    print(0)
else:
    print((N-1)*N//2)
# Judge status: Wrong Answer
N,_,*L=map(int,open(0).read().split())
for n in range(N):print(L.count(n+1))
# Judge status: Wrong Answer
import heapq
N , M =map(int,input().split())
L = [[] for _ in range(M + 1)]

for i in range(N):
  a,b = map(int,input().split())
  if a <= M:
    L[a].append(-b)

work = []
heapq.heapify(work)
ans = 0

for i in range(M,-1,-1):
  for j in range(len(L[i])):
    heapq.heappush(work,L[i][j])
    
  if len(work) > 0:
    ans -= heapq.heappop(work)
  
print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-
 
A = int(input())
B = int(input())
C = int(input())
X = int(input())
 
count = 0
 
for i in range(A + 1):
  for j in range(B + 1):
    for k in range(C + 1):
      if 500 * i + 100 * j + 50 * k == X:
        count += 1
print(count)
# Judge status: Wrong Answer
N=int(input())
A=[int(i) for i in input().split()]
col=[0 for i in range(8)]
fre=0
for a in A:
  if a<3200:
    col[a//400]+=1
  else:
    fre+=1
ans=0
# print(col)
for c in col:
  if c>0:
    ans+=1
MIN=1 if ans==0 else ans
ans+=fre
MAX=ans if ans<=8 else 8
print(MIN,MAX)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

print(len(input()) * 'X')
# Judge status: Accepted
def solve():
    s = input()
    for i in range(2,len(s)):
        ed = len(s)-i
        mid = ed//2
        if s[:mid] == s[mid:ed]:
            print(len(s[:ed]))
            return
if __name__=='__main__':
    solve()
# Judge status: Wrong Answer
# dequeでいくわ
from collections import deque
n = int(input())
a = list(input().split())
ans = deque()
for i in range(n):
    if i % 2 == 0:
        ans.append(a[i])
    else:
        ans.appendleft(a[i])
print(" ".join(ans))
# Judge status: Wrong Answer
k = int(input())
if 1 <= k <= 179:
  num = 360 / k
  if isinstance(num, int):
  	print(num)
  else:
    print(360 * k)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

a = sorted(a, reverse=True)
ans = 0
for i in range(1, n):
    ans += a[i // 2]
print(ans)
# Judge status: Accepted
k = int(input())

even = k//2
odd = k - even
print(odd*even)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
print("Yes" if a<=b<=c else "No")
# Judge status: Accepted
N,X=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
b=0
for i in range(0,N):
    if X>=a[i]:
        X=X-a[i]
        b+=1
        if i==len(a)-1 and (X+a[i])!=a[i]:
            b-=1
            break
    else:
        break
print(b)
# Judge status: Wrong Answer
a,b = map(int,input().split())
if a == 0 or b == 0:
  print("Zero")
else:
  if 0<a<=b<=10**9+1:
    print("Positive")
  elif a<=0<=b<=10**9+1:
    print("Zero")
  elif a<=b<0:
    if (b-a+1%2)==0:
      print("Positive")
    else:
      print("Negative")
# Judge status: Wrong Answer
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import Counter


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

    result = 0
    for key, value in Counter(A).items():
        result += min(value, abs(value - key))
    print(result)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
#!/usr/bin/python3
# -*- coding: utf-8 -*-

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

if K * 500 >= X:
    print("yes")
else:
    print("No")
# Judge status: Wrong Answer
def impossible(a,b,P):
    if(b == 0 and P == 1):
        return True
    if(a == 0 and b == 1 and P == 0):
        return True
    
    return False

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

lists = list(map(int,input().split()))
dp = [0] * 2

for l in lists:
    if(l % 2 == 0):
        dp[0] += 1
    else:
        dp[1] += 1

if(impossible(dp[0],dp[1],P)):
    ans = 0
else:
    ans = 2 ** (dp[0] + dp[1] - 1)

print(ans)
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
x = int(input())
counter = 0

for i in range(a+1):
    oturi = x-500*i
    if oturi < 0:
        break
    else:
        for j in range(b+1):
            oturi_2 = oturi-100*j
            if oturi_2 < 0:
                break
            else:
                if oturi_2 // 50 <= c:
                    counter += 1
print(counter)
# Judge status: Wrong Answer
S = str(input())
li = []
dic = {}
ans = 0

s = 0
d = 1
for i in range(len(S)):
  s += int(S[len(S)-1-i]) * d
  s = s % 2019
  if s == 0:
    ans += 1
  elif s not in li:
    li.append(s)
  elif s not in dic:
    dic[s] = 2
  else:
    dic[s] += 1
  d *= 10
  d = d % 2019
  
li = list(dic.values())
for l in li:
  ans += l * (l-1) // 2

print(ans)
# Judge status: Wrong Answer
n = int(input())
s = input()
e = [0] * (n + 1)
w = [0] * (n + 1)

for i in range(len(s)):
    if s[i] == "E":
        e[i+1] = e[i] + 1
        w[i+1] = w[i]
    else:
        w[i+1] = w[i] + 1
        e[i+1] = e[i]

t = [0] * n
ans = 10 ** 9
for i in range(0, n):
    t = w[i] + e[n] - e[i]
    ans = min(ans, t)

print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-
# input
n = int(input())
a = list(map(int, input().split()))

for i in range(n):
    if a[i] % 6 == 0:
        pass
    elif a[i] % 10 == 0:
        pass
    elif a[i] % 2 > 0:
        pass
    else:
        print('DENIED')
        exit()
print('APPROVED')
# Judge status: Accepted
import sys
def input():
  return sys.stdin.readline().rstrip()

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

temp=0
for i in range(N):
  if A[i]%2==1:
    temp+=1
if temp==0:
  print(1<<N if P == 0 else 0)
else:
  print(1<<(N-1))
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
def linersearch(N,A):
    for i in range(N):
        if A[i]%2==0:
            if A[i]%3==0 or A[i]%5==0:
                return "APPROVED"
            else:
                return "DENIED"
linersearch(N,A)
# Judge status: Wrong Answer
N = int(input())
A = [int(input()) for _ in range(N)]
A.append(0)

A.sort()

con = False
ans = 0
for i in range(N):
    if A[i] >=2:
        ans += A[i]//2
        A[i] -= A[i]//2
    
    mm = min(A[i+1],A[i])
    ans += mm
    A[i+1] -= mm
    A[i] -= mm


print(ans)
# Judge status: Accepted
from collections import deque
x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p_1 = deque(sorted(p))
q_1 = deque(sorted(q))
r_1 = sorted(r)
while len(p_1) > x:
  p_1.popleft()
while len(q_1) > y:
  q_1.popleft()
pqr = deque(sorted(list(p_1) + list(q_1) + r_1))
i = 0
ans = 0
while i < x+y:
  ans += pqr.pop()
  i += 1
print(ans)
# Judge status: Accepted
L,R,d= (int(x) for x in input().split())
count = 0
for i in range(L,R+1):
    if i % d ==0:
        count += 1
print(count)
# Judge status: Accepted
a,b = map(int, input().split())
print(a+b//2)
# Judge status: Wrong Answer
a,b =map(int,input().split())
n=a*b
if 1<= n<= 9:
    if 1<= a<=20:
        if 1<= b<= 20:
            print(a*b)
else:
    print(-1)
# Judge status: Wrong Answer
#DPまとめコンテストA問題より
infinity=10**6
N = int(input())
h = list(map(int,input().split()))

dp=[infinity]*N

dp[0]=0

for i in range(N-1):
    dp[i+1] = min(dp[i+1],dp[i]+abs(h[i+1]-h[i]))
    if i>=1:
        dp[i+1] = min(dp[i+1],dp[i-1]+abs(h[i+1]-h[i-1]))

print(dp[N-1])
# Judge status: Wrong Answer
n, a, b = map(int, input().split())
x = 0

for i in range(n+1):
  q = i // 1000
  qi = i % 1000
  w = qi // 100
  wi = qi % 100
  e = wi // 10
  ei = wi % 10
  r = ei
  sum = q + w + e + r
  if sum >= a and sum <= b:
    x += i
    
print(x)
# Judge status: Wrong Answer
S = list(input())

s = set(S)

L = len(S)

l = len(s)

if L == l:
  print('Yes')

else:
  print('No')
# Judge status: Accepted
import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
mod=pow(10,9)+7

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

if a==b and b!=c:
    print("Yes")
elif b==c and c!=a:
    print("Yes")
elif c==a and a!=b:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
a=input().split(" ")
sum1=int(a[0])+int(a[1])
sum2=int(a[0])+int(a[2])
sum3=int(a[1])+int(a[2])
print(sum1)
print(sum2)
print(sum3)

if sum1==int(a[2]) or sum2==int(a[1]) or sum3==int(a[0]):
	print("Yes")
else:
	print("No")
# Judge status: Accepted
n,m = list(map(int,input().split()))
harr = list(map(int,input().split()))
ans = [True] * n
for i in range(m):
    a,b = list(map(int,input().split()))
    s = harr[a-1]; t = harr[b-1]
    if s > t:
        ans[b-1] = False
    elif s < t:
        ans[a-1] = False
    else:
        ans[a-1] = ans[b-1] = False

print(sum(ans))
# Judge status: Accepted
# ABC149
# B Greesy Takahashi
# takはA枚、aokiはB枚、TAKはK回
a, b, k = map(int, input().split())
if k > a:
    if k - a > b:
        print(0,0)
    else:
        print(0,b - (k - a))
else:
    print(a-k,b)
# Judge status: Accepted
n,m=map(int,input().split())
inl=list(input())
try:
    for t in range(n):
        int(inl[t])
    for s in range(m):
        int(inl[n+1+s])
    if inl[n]=="-":
        print("Yes")
    else:
        print("No")
except Exception as e:
    print("No")
# Judge status: Accepted
import fractions

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

ans = t[0]
for i in range(1,n):
    ans = ans * t[i] // fractions.gcd(ans, t[i])

print(ans)
# Judge status: Wrong Answer
N=list(str(input()))
print(int(N[0])-1+9*(len(N)-1))
# Judge status: Accepted

def main():
    x = int(input())
    if x <=599:
        print("8")
    elif x <= 799:
        print("7")
    elif x <= 999:
        print("6")
    elif x <= 1199:
        print("5")
    elif x<=1399:
        print("4")
    elif x<=1599:
        print("3")
    elif x<=1799:
        print("2")
    else:
        print("1")
main()
# Judge status: Accepted
A = [1,6,9,36,81,216,729,1296,6561,7776,46656,59049]
N = int(input())

dp = [N] * (N+1)
dp[0] = 0
for i in range(1, N+1):
    for j in A:
        if i >= j:
            dp[i] = min(dp[i], dp[i - j] + 1)

print(dp[N])
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
from fractions import gcd
from functools import reduce
def lcm(x,y):
  return (x*y)//gcd(x,y)
mod = 10**9+7
l = reduce(lcm, a) % mod
ans = 0
for i in range(n):
  ans += l * pow(a[i], mod - 2, mod)
  ans %= mod
print(ans)