Harryxun/stf_run huggingface dataset:
N,A,B = map(int,input().split())

output = 0
digitsum = 0

for i in range(N): 
  # set condition for i < 10^4
  if i < 10:
	digitsum = i//10 + i%10
  elif i<100:
    digitsum = i//10+i%10
  elif i<1000:
    digitsum = i//100+(i%100)//10+(i%100)%10
  elif i<10000:
    digitsum= i//1000+(i%1000)//100+((i%1000)%100)//10+((i%1000)%100)%10
  else:
    digitsum = 0

  if A <= digitsum and digitsum <= B:
  	output += i
    
print (output)



### FIXED CODE ###

 
N,A,B=map(int,input().split())
 
sum_k=0
 
for i in range(N+1):
    if i <10:
        k=i
    elif i<100:
        k=i//10+i%10
    elif i<1000:
        k=i//100+(i%100)//10+(i%100)%10
    elif i<10000:
        k=i//1000+(i%1000)//100+((i%1000)%100)//10+((i%1000)%100)%10
    else:
        k=1
    if A<=k and k<=B:
        sum_k=sum_k+i
      
print(sum_k)
import sys
if sys.argv[-1] == 'ONLINE_JUDGE':
    import os, zlib, base64
    open('solve.pyx', 'wb').write(zlib.decompress(base64.b85decode("c${TYO>cuR480@qAH2g<Sknro9VRsPM>-Bp2oMbdN;6g4ub)FGU-bp-_x$|gq%wU6t>WT*wMOY0gzARgSm<PTl{O42M-acZ>GgR)gKaC@nKT&GwVX(kN~!u8ucZ|Y8b(B=Z50NhloinL<u!3pzz_z0QZz6)r3^d(FK|_Vvacc{$MMog(mIMk_qA%XFaU}f;tT}jkofYgQLTh@BDvrMPL85@DXWT*4|sdefE$V53*yuSSxFN(66Zu54;pEIj0Umt)k-X-adrW>{z!kgU_m32?B0nU8teJJ*Jbf$fUB%#Xa*evWbUMjfo0CYP1$BMPdnFcOFr$kY1JE0q&D4MM1o^;p2n+H;kN0%y<G_x??~H8ckBt`JBapy@RS2z&0Fv3lRmuIfi5g*;$zvl;E!eJz;4T<{4pQ(_Xsb%`n(^%9vv^Ycp5Is*%R6LGR8Cv{L_vO&*hgs(2dYZ{{h3n*31")))
    os.system('cythonize -i -3 -b solve.pyx')
import solve

### FIXED CODE ###

from networkx import*
print(max(*map(len,connected_components(Graph([*map(str.split,open(0))][1:]))),1,1))
w = input()
cnt = 0
while(True):
    t = input()
    if t == "END_OF_TEXT":
        break
    t = t.lower
    t = t.split()
    for i in t:
        if i == w:
            cnt += 1
print(cnt)


### FIXED CODE ###

w = input()
cnt = 0
while(True):
    t = input()
    if t == "END_OF_TEXT":
        break
    t = t.lower().split()
    for i in t:
        if i == w:
            cnt += 1
print(cnt)
import math
import numpy as np
np.set_printoptions(suppress=True)

A, B = map(str, input().split())
A = int(A)
B = decimal.Decimal(B)
print(math.floor(A*B))

### FIXED CODE ###

import math
import decimal

A, B = map(str, input().split())
A = int(A)
B = decimal.Decimal(B)
print(math.floor(A*B))
N = int(input())
nums = [0] * 10000
data = list(map(int, input().split()))
for A in data:
    nums[A-1] += 1
    nums[A] += 1
    nums[A+1] += 1
print(max(nums))


### FIXED CODE ###

N = int(input())
nums = [0] * 100002
data = list(map(int, input().split()))
for A in data:
    nums[A-1] += 1
    nums[A] += 1
    nums[A+1] += 1
print(max(nums))
N = int(input())
AB = [list(map(int, input().split())) for _ in range(N-1)]

max_len = 0
for i, c in enumerate(con):
    if max_len <= len(c):
        max_len = len(c)
        max_ind = i

colors = [set() for i in range(N+1)]
all_colors = set([i for i in range(1, max_len+1)])
res = [0] * (N - 1)


for i, ab in enumerate(AB):
    res[i] = list(all_colors.difference(colors[ab[0]].union(colors[ab[1]])))[0]
    colors[ab[0]].add(res[i])
    colors[ab[1]].add(res[i])

print(max_len)
for r in res:
    print(r)

### FIXED CODE ###

N = int(input())
AB = [list(map(int, input().split())) for _ in range(N-1)]
sortedAB = sorted(AB)
con = {i: [] for i in range(1, N+1)}
color = [0] * (N + 1)
for a, b in sortedAB:
    con[a].append(b)

for i in range(1, N + 1):
    now_c = 1
    for c in con[i]:
        if color[i] == now_c:
            now_c += 1
        color[c] = now_c
        now_c += 1

print(max(color))
for i in range(N-1):
    print(color[AB[i][1]])

a = 0
def resolve():
    a, b = list(map(int, input().split()))
    l = list(range(a, b + 1))
    if 0 < a and a <= b:
        print('Positive')
    elif a <= b and b < 0:
        if (b - a + 1) % 2 == 0:
            print('Positive')
        else:
            print('Negative')
    elif a <= 0 and 0 <= b:
        print('Zero')
    return


resolve()

### FIXED CODE ###

def resolve():
    a, b = list(map(int, input().split()))

    if a <= 0 and b >= 0:
        print('Zero')
    elif b < 0 and (b - a + 1) % 2 == 1:
        print('Negative')
    else:
        print('Positive')
    return


resolve()
import numpy as np
w = input()
index, count = np.unique(list(w), return_counts=True)
if all(count % 2 == 0):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

w = input()
# index, count = np.unique(list(w), return_counts=True)
d = {}
for c in w:
    if c in d.keys():
        d[c] += 1
    else:
        d.setdefault(c, 1)
for i, j in d.items():
    if j % 2 == 1:
        print('No')
        break
else:
    print('Yes')
def adana ('S'):
    return S[0:3]

### FIXED CODE ###

S = input()
print (S[0:3])
n=int(input())
s=list(input())
e=s.count("E")
w=n-e
ans=e
nume=0
numw=0
for i in range(n):
    if s[i]=="E":
        nume+=1
    else:
        numw+=1
    ans=min(ans,numw+e-nume)
print(ans)


### FIXED CODE ###

a,b=map(int,input().split())
c=a+b
d=a-b
e=a*b
print(max(c,d,e))
n=input()
s=[0]*n
for i in range(n):
    s[i]=input()
se=set(s)
print(len(se))

### FIXED CODE ###

n=int(input())
s=[0]*n
for i in range(n):
    s[i]=input()
se=set(s)
print(len(se))
n = int(input())
H = list(map(int, input().split()))
ans = 0
for i in range(n):
  if(H[0] <= H[i] and H[1] <= H[i] and H[i-1] <= H[i]):
    ans += 1
print(ans)


### FIXED CODE ###

n = int(input())
H = list(map(int, input().split()))
ans = 0
t = 0

for i in range(n):
  t = max(t,H[i])
  if(t == H[i]):
    ans += 1
print(ans)
# 引用：https://qiita.com/snow67675476/items/e87ddb9285e27ea555f8
def get_fact(n):
    arr = []
    a_append = arr.append
    temp = n
    for i in range(2, int(-(-n ** 0.5 // 1) + 1)):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            a_append([i, cnt])

    if temp != 1:
        a_append([temp, 1])

    if not arr:
        a_append([n, 1])

    return arr


# input
A, B = map(int, input().split())

# check
# 参考：https://drken1215.hatenablog.com/entry/2019/10/03/175800
# ①最大公約数の素因数分解を求める
g = gcd(A, B)
fact = [f[0] for f in get_fact(g)]

# ②指数を省き、カウントする
elem = [1]
e_append = elem.append
for f in fact:
    if f not in elem:
        e_append(f)

print(len(elem))


### FIXED CODE ###

def gcd(m, n):
    x = max(m, n)
    y = min(m, n)
    z = None
    if x % y == 0:
        return y
    else:
        while x % y != 0:
            z = x % y
            x = y
            y = z
        return z


# 引用：https://qiita.com/snow67675476/items/e87ddb9285e27ea555f8
def get_fact(n):
    arr = []
    a_append = arr.append
    temp = n
    for i in range(2, int(-(-n ** 0.5 // 1) + 1)):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            a_append([i, cnt])

    if temp != 1:
        a_append([temp, 1])

    if not arr:
        a_append([n, 1])

    return arr


# input
A, B = map(int, input().split())

# check
# 参考：https://drken1215.hatenablog.com/entry/2019/10/03/175800
# ①最大公約数の素因数分解を求める
g = gcd(A, B)
fact = [f[0] for f in get_fact(g)]

# ②指数を省き、カウントする(1は確実にあるので予めカウントしておく)
elem = [1]
e_append = elem.append
for f in fact:
    if f not in elem:
        e_append(f)

print(len(elem))
Copy
D = int(input())
 
if D ==25;
  print("Christmas")
if D ==24;
  print("Christmas Eve")
if D ==23;
  print("Christmas Eve Eve")
if D ==22;
  print("Crhistmas Eve Eve Eve")

### FIXED CODE ###

D = int(input())
if D == 25:
  print("Christmas")
elif D == 24:
  print("Christmas Eve")
elif D == 23:
  print("Christmas Eve Eve")
elif D == 22:
  print("Christmas Eve Eve Eve")
lis = map(int,input().split())
 
def counter(x):
  count = 0 
  while x%2 ==0:
    x = x/2
    count += 1
  return count
 
min(counter,lis)

### FIXED CODE ###

def counter(a):
  count = 0 
  while a%2 ==0:
    a /= 2
    count += 1
  return count
N = int(input())
s = [int(n) for n in input().split()]
print(min([counter(a) for a in s]))
def SumIndicatedPoint(pcandid):
	point = list(str(pcandid))
	conNum = nums[0]
	count = 1
	sum = 0
	for p in point:
		if p == '0':
			conNum = conNum + nums[count]
		elif p == '1':
			sum = sum + int(conNum)
			conNum = nums[count]
		count = count + 1
	sum = sum + int(conNum)
	#print(str(sum))	
	return sum
	
if __name__ == '__main__':	
	nums = list(input())
	#nums.reverse()
	pcandidstr = '0' + str(len(nums) - 1) + 'b'
	pcandid = 0
	maxcandid = int('1' * (len(nums) - 1),2)
	#add = format(1,pcandidstr)
	ALLSUM = 0
	while pcandid <= maxcandid:
		ALLSUM = ALLSUM + SumIndicatedPoint(format(pcandid,pcandidstr))
		pcandid = pcandid + 1
	print(str(ALLSUM))

### FIXED CODE ###

def SumIndicatedPoint(pcandid):
	point = list(str(pcandid))
	conNum = nums[0]
	count = 1
	sum = 0
	for p in point:
		if p == '0':
			conNum = conNum + nums[count]
		elif p == '1':
			sum = sum + int(conNum)
			conNum = nums[count]
		count = count + 1
	sum = sum + int(conNum)
	#print(str(sum))	
	return sum
	
if __name__ == '__main__':	
	nums = list(input())
	#nums.reverse()
	ALLSUM = 0
	pcandidstr = '0' + str(len(nums) - 1) + 'b'
	pcandid = 0
	if len(nums) > 1:
		maxcandid = int('1' * (len(nums) - 1),2)
		#add = format(1,pcandidstr)
		while pcandid <= maxcandid:
			ALLSUM = ALLSUM + SumIndicatedPoint(format(pcandid,pcandidstr))
			pcandid = pcandid + 1
	elif len(nums) == 1:
		ALLSUM = int(nums[0])
	print(str(ALLSUM))
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

S = input()
y, m, d = [int(x) for x in S.split('/')]
if y>=2020:
    answer = "Heisei"
elif:
    y = 2019 and m >= 5:
    answer = "Heisei"
else:
    answer = "TBD" 

### FIXED CODE ###

#! /usr/bin/env python3
# -*- coding: utf-8 -*-

S = input()
ls = [x for x in S.split("/")]
y = int(ls[0])
m = ls[1]
if y<=2018:
    a = "Heisei"
elif y == 2019 and m in ["01" ,"02", "03","04"]:
    a = "Heisei"
else:
    a = "TBD"
print(a)
h, w = map(int, input().split())
a = [list(input()) for _ in range(h)]

dy = [0, 1]
dx = [1, 0]

stack = [[0 for _ in range(w)] for _ in range(h)]

def dfs(y, x):
    stack[y][x] = 1
    if x == w-1 and y == h-1:
        return
    for i in range(2):
        ny = y + dy[i]
        nx = x + dx[i] 
        if ny < 0 or ny >= h or nx < 0 or nx >= w:
            continue
        if a[ny][nx] == "#":
            dfs(ny, nx)
            break
    return

dfs(0, 0)
for i in range(h):
    for j in range(w):
        if a[i][j] == "#" and stack[i][j] == 0:
            print('Impossible')
                exit()
    print('Possible')

### FIXED CODE ###

h, w = map(int, input().split())
a = [list(input()) for _ in range(h)]

dy = [0, 1]
dx = [1, 0]

stack = [[0 for _ in range(w)] for _ in range(h)]

def dfs(y, x):
    stack[y][x] = 1
    if x == w-1 and y == h-1:
        return
    for i in range(2):
        ny = y + dy[i]
        nx = x + dx[i] 
        if ny < 0 or ny >= h or nx < 0 or nx >= w:
            continue
        if a[ny][nx] == "#":
            dfs(ny, nx)
            break
    return

dfs(0, 0)
for i in range(h):
    for j in range(w):
        if a[i][j] == "#" and stack[i][j] == 0:
            print('Impossible')
            exit()
print('Possible')
N, M = map(int,input().split())
a = []
dev = 100000007

for _ in range(M):
    aa = int(input())
    a.append(aa)

ans = 0
flag = True
a.append(N+1)

for i in range(M-1):
    if a[i+1] == a[i]+1:
        flag = False
        break

def fadd(n):
    if n == 1:
        return 1
    elif n == 2:
        return 2
    elif n == 0:
        return 0
    else:
        return fadd(n-1)%dev + fadd(n-2)%dev
    
if flag:
    
    pa = 0 
    for i,na in enumerate(a):
        print(i,na)
        ans += fadd(na - 1 - pa)%dev
        pa = na + 1

print(ans)

### FIXED CODE ###

N, M = map(int,input().split())
a = [int(input()) for _ in range(M)]

dev = 1000000007
dp = [0 for _ in range(N+1)]
dp[0] = 1
dp[1] = 1

fall = [1 for _ in range(N+1)]

for i in range(M):
    fall[a[i]] = 0

for i in range(1,N):
    dp[i+1] = dp[i]*fall[i] + dp[i-1]*fall[i-1]
    dp[i+1] %= dev

print(dp[N])
from collections import Counter
 
N = int(input())
A = sorted(list(map(int,input().split())))
 
edible = sum(i-1 for i in Counter(A).values())
print(len(set(A))-edible%2)

### FIXED CODE ###

x=int(input())
if x<1200:
  print("ABC")
else:
  print("ARC")
import sys

status = input()
out = {"Sunny", "Cloudy", "Rainy"}

if(status==out[0])
	print(out[1])
elif(status==out[1])
	print(out[2])
elif(status==out[2])
	print(out[0])

### FIXED CODE ###

import sys

status = input()
out = ["Sunny", "Cloudy", "Rainy"]

if status==out[0]:
	print(out[1])
elif status==out[1]:
	print(out[2])
elif status==out[2]:
	print(out[0])
N = int(input())
memo = 1
ans = []
tmp = int(input())
for i in range(1,N):
    A = int(input())
    if A <= tmp:
        memo += 1
    else:
        ans.append(memo)
        memo = 1
    tmp = A
ans.append(memo)
print(max(ans))

### FIXED CODE ###

r = int(input())
print(3*(r**2))
n,m = map(int,input().split())

li=[]
for i in (1, m+1):
    s=list(map(int, input().split()))
    s.pop(0)
    li.append(s)

p = list(map(int, input().split()))
#print(li)
#print(p)

def check(g,en):
    stack = ["1", "0"]
    candi = []
    while stack:
        cur = stack.pop()
        if len(cur) == en:
            candi.append(cur)
            continue
        for i in g[len(cur)+1]:
            tmp = cur+i
            stack.append(tmp)
    return candi

g={}
for i in range(0,n+1):
    g[i]=["1", "0"]

ans = 0
print(check(g,n))
for i in check(g,n):
    flag=0
    for j in range(m):
        tmp=0
        for k in range(0,len(li[j])):
            tmp += int(i[li[j][k]-1])
        if tmp % 2  != p[j]:
            flag=1
            break
    if flag==0:
        print(i)
        ans += 1

print(ans)

### FIXED CODE ###

n,m = map(int,input().split())

li=[]
for i in range(1, m+1):
    s=list(map(int, input().split()))
    s.pop(0)
    li.append(s)

if m==1:
    p = [int(input())]
else:
    p = list(map(int, input().split()))
#print(li)
#print(p)

def check(g,en):
    stack = ["1", "0"]
    candi = []
    while stack:
        cur = stack.pop()
        if len(cur) == en:
            candi.append(cur)
            continue
        for i in g[len(cur)+1]:
            tmp = cur+i
            stack.append(tmp)
    return candi

g={}
for i in range(0,n+1):
    g[i]=["1", "0"]

ans = 0
#print(check(g,n))
for i in check(g,n):
    flag=0
    for j in range(m):
        tmp=0
        for k in range(0,len(li[j])):
            tmp += int(i[li[j][k]-1])
        if tmp % 2 != p[j]:
            flag=1
            break
    if flag==0:
        #print(i)
        ans += 1

print(ans)
import fractions
N=int(input())
A=list(map(int,input().split()))
c=1
a=0
w=10**9+7
for A_ in A:
    c_=c*A_//fractions.gcd(c,A_)
    a=((a+c//)*c_/c)%w
    #a=(a*c_//c+c_//A_)%w
    c=c_
print(int(a))

### FIXED CODE ###

import fractions
N=int(input())
A=list(map(int,input().split()))
c=1
a=0
w=10**9+7
for A_ in A:
    c=c*A_//fractions.gcd(c,A_)
for A_ in A:
    a+=c//A_
print(int(a%w))
n,b,sta=map(int,input().split())
A=list(map(int,input().split()))
Z=["F" for i in range(n+1)]
for i in A:
  A[i]="B"
fi=A[:n:]
se=A[n+1::]
print(min(fi.count("B"),se.count("B")))


### FIXED CODE ###

n,b,sta=map(int,input().split())
A=list(map(int,input().split()))
Z=["F" for i in range(n+1)]
for i in A:
  Z[i]="B"
fi=Z[:sta:]
se=Z[sta+1::]
print(min(fi.count("B"),se.count("B")))
t1, t2 = map(int, input().split())
a1,a2 = map(int, input().split())
b1, b2 = map(int, input().split())
#t1で生まれる差
P = (a1 - b1) * t1
#t2で生まれる差
Q = (a2 - b2) * t2
#P < 0 のことを仮定する
if P > 0:
    P *= -1
    Q *= -1

if P + Q < 0:
    print(0)
elif P == Q:
    print("infinity")
else:
    #つぎのPを足したときに、負にいくかどうか？
    if (-P) % (P + Q) == 0:
        print(2 * ((-P) // (P + Q)) + 2)
    else:
        print(2 * ((-P) // (P + Q)) + 1)


### FIXED CODE ###

t1, t2 = map(int, input().split())
a1,a2 = map(int, input().split())
b1, b2 = map(int, input().split())
#t1で生まれる差
P = (a1 - b1) * t1
#t2で生まれる差
Q = (a2 - b2) * t2
#P < 0 のことを仮定する
if P > 0:
    P *= -1
    Q *= -1

if P + Q < 0:
    print(0)
elif P + Q == 0:
    print("infinity")
else:
    #つぎのPを足したときに、負にいくかどうか？
    i = P * (-1)
    if i % (P + Q) == 0:
        print(2 * (i // (P + Q)))
    else:
        print(2 * (i // (P + Q)) + 1)
def checks(s) :
	ret = 'NO'
	if len(s) < 5 :
		return 'NO'
	elif( s[0] == 'd' ) :
		#dream
		if s[:5] == 'dream' :
			if len(s) != 5 :
				ret = checks(s[5:])
			else :
				return 'YES'
		#dreamer
		if ( len(s) > 6 ) and ( ret != 'YES' ) and s[:7] == 'dreamer' :
			if len(s) != 7 :
				ret = checks(s[7:])
			else :
				return 'YES'
	elif( s[0] == 'e' ) :
		#erase
		if s[:5] == 'erase' :
			if len(s) != 5 :
				ret = checks(s[5:])
			else :
				return 'YES'
		#eraser
		if ( len(s) > 5 ) and ( ret != 'YES' ) and s[:6] == 'eraser' :
			if len(s) != 6 :
				ret = checks(s[6:])
			else :
				return 'YES'
	return ret

S = input()

print(checks(S))

### FIXED CODE ###

s = input()

tmp_index = 0

while(len(s) - tmp_index > 4) :

	if( s[tmp_index] == 'd' ) :
		if s[tmp_index:tmp_index+7] == 'dreamer' :
			if ( s[tmp_index + 5:tmp_index + 10] == 'erase' ):
				tmp_index += 5
			else :
				tmp_index += 7
		elif s[tmp_index:tmp_index+5] == 'dream' :
			tmp_index += 5
		else :
			tmp_index = len(s) - 1
			
	elif( s[tmp_index] == 'e' ) :
		if  s[tmp_index:tmp_index + 6] == 'eraser' :
			tmp_index += 6
		elif s[tmp_index:tmp_index+5] == 'erase' :
			tmp_index += 5
		else :
			tmp_index = len(s) - 1
	else :
		tmp_index = len(s) - 1
	if len(s) == tmp_index :
		print('YES')
	elif len(s) - tmp_index < 5 :
		print('NO')
import sys
rec=rho=0
for line in sys.stdin:
"""while True:
	line=raw_input()
	if line=="a":
		break
"""
	a,b,c=map(int,line.split(","))
	if a==b:
		rho+=1
	elif a*a+b*b==c*c:
		rec+=1
print rec
print rho

### FIXED CODE ###

import sys
rec=rho=0
for line in sys.stdin:
	a,b,c=map(int,line.split(","))
	if a==b:
		rho+=1
	elif a*a+b*b==c*c:
		rec+=1
print rec
print rho
import math
from functools import reduce


def gcd_list(numbers):
    return reduce(math.gcd, numbers)


N, X = map(int, input().split())
toshi = list(map(int, input().split()))
toshi.sort()
if N == 1:
    print(toshi[0] - X)
    exit()

diff = [abs(X - toshi[0])]

for i in range(N - 1):
    diff.append(abs(toshi[i+1] - toshi[i]))

print(gcd_list(diff))


### FIXED CODE ###

import fractions
from functools import reduce

n, x = map(int, input().split())
xl = list(map(int, input().split()))
xl.append(x)
xl.sort()
xldiv = []
for i in range(n):
    xldiv.append(xl[i + 1] - xl[i])

print(reduce(fractions.gcd, xldiv))
#Shiritori

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

if ( a[-1]==b[0] and b[-1]==c[0] ):
    print("YES")
else:
    prtin("NO")

### FIXED CODE ###

#Shiritori
a,b,c = input().split()

if ( a[-1]==b[0] and b[-1]==c[0] ):
    print("YES")
else:
    print("NO")
N = int(input())
S = []
for i in range(N):
    s = str(input())
    s = ''.join(sorted(s))
    S.append(s)

count = 0
for i in range(N):
    Si = S[i]
    for k in range(N):
        if i==k:
            None
        else:
            Sk = S[k]
            if Sk == Si:
                count += 1

print(count / 2)


### FIXED CODE ###

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

X = []
X.append(A+B)
X.append(A-B)
X.append(A*B)

X.sort()

print(X[2])
def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


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

D = defaultdict(int)
for a in A:
    D[a] += 1

L = []
for k, v in D.items():
    if v > 1:
        continue
    L.append(k)

if len(L) == 0:
    print(0)
    exit()

L.sort()

ans = set()
for n in L:
    if is_prime(n):
        ans.add(n)
    flg = True
    for s in ans:
        if n % s == 0:
            flg = False
            break
    if flg is False:
        continue
    ans.add(n)

print(len(ans))


### FIXED CODE ###


import sys
from collections import defaultdict

sys.setrecursionlimit(10 ** 7)
# ----------

INF = float("inf")
MOD = 10 ** 9 + 7
# ----------

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

if N == 1:
    print(1)
    exit()

if A[0] == A[1] == 1:
    print(0)
    exit()
if A[0] == 1:
    print(1)
    exit()


S = set()

for a in A:
    i = 2
    while a * i <= 10 ** 6:
        S.add(a * i)
        i += 1

ans = []
for a in A:
    if not a in S:
       ans.append(a)


D = defaultdict(int)
for a in ans:
    D[a] += 1

L = []
for k, v in D.items():
    if v > 1:
        continue
    L.append(k)


print(len(L))
H, A = map(int, input.split())
i = 0
while H > 0:
  H -= A
  i += 1
print(i)


### FIXED CODE ###

H, A = map(int, input().split())
i = 0
while H > 0:
  H -= A
  i += 1
print(i)
A,B = (int(x) for x in input().split())
if A >=10 or B >:
	print(-1)
else:
    print(A*B)


### FIXED CODE ###

A,B = (int(x) for x in input().split())
if A >=10 or B >=10:
	print(-1)
else:
    print(A*B)
[l,r] = [int(i) for i in input().split()]

ans = []

if l > 2019 and r > 2019:
	l %= 2019
	r %= 2019
	
elif l <= 2019 and r > 2019:
	r %= 2019
	s = l
	l = r
	r = s
	
if l == r:
	l %= 2019
	r %= 2019
	print(l*r%2019)
	
else:	
	for i in range(l,r):
		for j in range(i+1,r+1):
			rem = i*j%2019
			ans.append(rem)

	print(min(ans))	
	

### FIXED CODE ###

L, R = list(map(int, input().split(' ')))
#print(L, R)
 
min = 2019
for i in range(L, R):
    for j in range(i + 1, R + 1):
        mod_ij = (i * j) % 2019
        if min > mod_ij:
            min = mod_ij
            if min == 0:
                break
    if min == 0:
        break
print(min)
K = int(input())
if K % 2 == 0:
    print((K/2)**2)
else:
    print((k//2+1)*(k//2))


### FIXED CODE ###

K = int(input())
if K % 2 == 0:
    print(int((K/2)**2))
else:
    print(int((K//2+1)*(K//2)))
N = int(raw_input())
 
T = map(int, raw_input().split())
A = map(int, raw_input().split())
 
ans = 1
mod = 10 ** 9 + 7
 
if T[N - 1] != A[0]:
    print (0)
    exit()
 
for i in xrange(N):
    if i == 0 or i == N - 1:
        continue
    elif T[i] > T[i-1]:
        if A[i] < T[i] and A[i] == A[i + 1]:
            print (0)
            exit()
        elif A[i] != T[i] and A[i] != A[i + 1]:
            print (0)
            exit()
    else:
        if T[i] == A[i]:
            if A[i] == A[i + 1]:
                ans *= T[i]
        elif T[i] > A[i]:
            if A[i] == A[i + 1]:
                ans *= A[i]
        else:
            if A[i] == A[i + 1]:
                ans *= T[i]
            else:
                print (0)
                exit()
 
print (ans % mod)

### FIXED CODE ###

s = raw_input()

flag = 0
flag2 = 0

for i in s:
    if i == "C":
        flag += 1
    if flag > 0 and i == "F":
        flag2 += 1

if flag2 > 0:
    print "Yes"

else:
    print "No"
S = str(input())

if S == ABC:
  print("ARC")
else:
  print("ABC")

### FIXED CODE ###

S = str(input())

if S == 'ABC':
    print("ARC")
else:
    print("ABC")
_ = raw_input()
tests = [int(test) for test in raw_input().split(" ")]
total_time = sum(tests)
drinks = raw_input()
for _ in range(drinks):
    i = raw_input().split(" ")
    no, time = i[0], i[1]
    print total_time - (tests[no - 1] - time)


### FIXED CODE ###

_ = raw_input()
tests = [int(test) for test in raw_input().split(" ")]
total_time = sum(tests)
drinks = int(raw_input())
for _ in range(drinks):
    i = [int(x) for x in raw_input().split(" ")]
    no, time = i[0], i[1]
    print total_time - (tests[no - 1] - time)