Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

x,k,d = map(int,input().split())
ch = k%2
ans = abs(x)
cnt = 0
while True:
    cnt += 1
    if x == 0:
        if ((cnt-1)%2) == ch:
            print(0)
            break
        else:
            print(abs(d))
            break
    elif x > 0:
        x -= d
        if ans <= abs(x):
            if ch == cnt%2:
                print(abs(x))
                break                
            else:
                print(ans)
                break
        else:
            ans = abs(x)
    else:
        x += d
        if ans <= abs(x):
            if ch == cnt%2:
                print(abs(x))
                break
            else:
                print(ans)
                break
        else:
            ans = abs(x)
    if cnt == k:
        print(ans)
        break

### FIXED CODE ###

x,k,d = map(int,input().split())
ch = k%2
ans = abs(x)
cnt = 0
while True:
    if x == 0:
        if (cnt%2) == ch:
            print(0)
            break
        else:
            print(abs(d))
            break
    if x > 0:
        if x//d > k:
            print(x-k*d)
            break
        cnt += x//d
        x -= d*(x//d)
        xx = x - d
        if cnt%2 == ch:
            print(abs(x))
        else:
            print(abs(xx))
        break
    elif x < 0:
        if abs(x)//d > k:
            print(abs(x+k*d))
            break
        cnt += abs(x)//d
        x += d*(abs(x)//d)
        xx = x + d
        if cnt%2 == ch:
            print(abs(x))
        else:
            print(abs(xx))
        break
### BUGGY CODE ###

from collections import deque
H, W = map(int, input().split())
a = [input() for _ in range(H)]

#初期の黒("#")の位置からの距離
dist = [[-1] * W for _ in range(H)]

# "#"の位置をキューに追加
black = deque()
for h in range(H):
    for w in range(W):
        if a[h][w] == "#":
            black.append((h,w))
            dist[h][w] = 0
def bfs(black, dist):
    d = 0
    while black: #blackに中身が入っている間
        #キューとして使うから左から出すpopleft()
        h, w = black.popleft()
        d = dist[h][w]
        for dy,dx in((1,0), (0,1), (-1, 0), (0,-1)):
            new_h = h + dy
            new_w = w + dx
            if new_h < 0 or H <= new_h or new_w < 0 or W <= new_w:
                continue
            if dist[new_h][new_w] == -1:
                dist[new_h][new_w] = d+1
                black.append((new_h, new_w))
    return d

d = bfs(black, dist)
print(d)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.readline

H,W = map(int,input().split())
INF = 10**18
q = []

visited = [[True]*(W+2)]
visited += [[True] + [x == '#' for x in input().rstrip()] + [True] for _ in range(H)]
visited.append([True]*(W+2))
for i in range(1,H+1):
  for j in range(1,W+1):
    if visited[i][j]:
      q.append((i,j))

moves = [(0,1),(0,-1),(1,0),(-1,0)] #全方向調べる

ans = -1
while q:
  qq = []
  ans += 1
  for x,y in q:
    if not visited[x-1][y]:
      visited[x-1][y] = True
      qq.append((x-1,y))
    if not visited[x+1][y]:
      visited[x+1][y] = True
      qq.append((x+1,y))
    if not visited[x][y-1]:
      visited[x][y-1] = True
      qq.append((x,y-1))
    if not visited[x][y+1]:
      visited[x][y+1] = True
      qq.append((x,y+1))
  q = qq
  
print(ans)
### BUGGY CODE ###

from collections import deque

N, K = [int(s) for s in input().split()]
V = [int(s) for s in input().split()]

que = deque([(set(), V, 0)])
best = 0
while que:
    s, v, n = que.pop()
    if n >= K:
        best = max([best, sum(s)])
        continue
    if v:
        que.append((s | set([v[0]]), v[1:], n + 1))
        if len(v) > 1:
            que.append((s | set([v[-1]]), v[:-1], n + 1))
    if s:
        for i in s:
            que.append((s - set([i]), [i] + v, n + 1))
            que.append((s - set([i]), v + [i], n + 1))

print(best)

### FIXED CODE ###

from collections import deque

N, K = [int(s) for s in input().split()]
V = [int(s) for s in input().split()]

best = 0
for a in range(min([K, N]) + 1):
    for b in range(min([K, N]) - a + 1):
        L = V[:a] + V[N - b:]
        Lp = [i for i in L if i >= 0]
        Lm = [i for i in L if i < 0]
        Lm.sort()
        s = sum(Lp + Lm[min([len(Lm), K - a - b]):])
        best = max([best, s])

print(best)
### BUGGY CODE ###

#問題文に連結と書いてあるのでどの部屋も互いに行き来できる
#自分がきたところを記録する幅優先探索をすればいい
n,m=list(map(int,input().split()))
road=[[0 for i in range(n)] for j in range(n)]
ab=[]
for i in range(m):
  a,b=list(map(int,input().split()))
  road[a-1][b-1]=1
  road[b-1][a-1]=1
from collections import deque
q=deque([1])
ans=[0 for i in range(n)]
check=[0 for i in range(n)]
check[0]=1
while len(q)>0: 
  
  p=q.popleft()
  for j in range(n):
    if road[p-1][j]!=0 and check[j]==0:
      q.append(j+1)
      road[p-1][j]=0
      road[j][p-1]=0
      check[j]=1
      ans[j]=p
print("Yes")
for i in range(1,n):
  print(ans[i])
  

  

### FIXED CODE ###

n,m=list(map(int,input().split()))
road_input=[]
for i in range(m):
    road_input.append(list(map(int,input().split())))

#隣接リスト
road=[[] for i in range(n+1)]
for i in range(m):
    road[road_input[i][0]].append(road_input[i][1])
    road[road_input[i][1]].append(road_input[i][0])

from collections import deque
q=deque([1])
ans=[-1 for i in range(n)]
while len(q)>0:
  p=q.popleft()
  for i in road[p]:
    if ans[i-1]== -1:
      ans[i-1]=p
      q.append(i)

print("Yes")
for j in range(1,n):
    print(ans[j])
### BUGGY CODE ###

n=int(input())
L=list(map(int,input().split()))
x=1
for i in range(n):
  x*=L[i]
if x>10**18:
  print(-1)
else:
  print(x)

### FIXED CODE ###

n=int(input())
L=list(map(int,input().split()))
if L.count(0)!=0:
  print(0)
else:
  L_1=sorted(L)
  x=1
  for i in range(n):
    x*=L_1[i]
    if x>10**18:
      x=-1
      break
  print(x)
### BUGGY CODE ###

MOD = 10 ** 9 + 7
N = int(input())
A = list(map(int, input().split()))
maxA = max(A)

maxA_len = len(bin(maxA)[2:])
num0_each_digit = [0 for _ in range(maxA_len)]
num1_each_digit = [0 for _ in range(maxA_len)]

for i in range(N):
    for i_bit, bit in enumerate(bin(A[i])[2:].zfill(maxA_len)):
        if bit == '0':
            num0_each_digit[i_bit] += 1
            num0_each_digit[i_bit] %= MOD
        else:
            num1_each_digit[i_bit] += 1
            num1_each_digit[i_bit] %= MOD
ans = 0
for i in range(maxA_len):
    factor = (2 ** (maxA_len - i - 1)) % MOD
    ans += (num0_each_digit[i] * num1_each_digit[i] * factor) % MOD

print(ans % MOD)

### FIXED CODE ###

MOD = 10 ** 9 + 7
N = int(input())
A = list(map(int, input().split()))
maxA = max(A)

maxA_len = len(bin(maxA)[2:])
num0_each_digit = [0 for _ in range(maxA_len)]
num1_each_digit = [0 for _ in range(maxA_len)]

for i in range(N):
    for i_bit, bit in enumerate(bin(A[i])[2:].zfill(maxA_len)):
        if bit == '0':
            num0_each_digit[i_bit] += 1
            num0_each_digit[i_bit] %= MOD
        else:
            num1_each_digit[i_bit] += 1
            num1_each_digit[i_bit] %= MOD
ans = 0
for i in range(maxA_len):
    factor = (2 ** (maxA_len - i - 1)) % MOD
    ans += (num0_each_digit[i] * num1_each_digit[i] * factor) % MOD

print(ans % MOD)
### BUGGY CODE ###

import sys

# %%

n, m = list(map(int, sys.stdin.readline().split()))
ary = sorted(list(map(int, sys.stdin.readline().split())), reverse=True)
bry = sorted(list(map(int, sys.stdin.readline().split())), reverse=True)
mod = 10 ** 9 + 7

# %%

if len(set(ary)) != len(ary) or len(set(bry)) != len(bry):
    print(0)

else:
    ary.append(0)
    bry.append(0)

    cnt = 1
    i = 0
    j = 0
    for num in range(n * m, 0, -1):

        if (num == ary[i]) & (num == bry[j]):
            i += 1
            j += 1

        elif (num == ary[i]) ^ (num == bry[j]):
            if num == ary[i]:
                cnt *= len(bry[:j])
                i += 1
            else:
                cnt *= len(ary[:i])
                j += 1

        else:
            na = len(ary[:i])
            nb = len(bry[:j])
            cnt *= (na * nb - (n * m - num))

        cnt = cnt % mod

    print(cnt)


### FIXED CODE ###

import sys

# %%

n, m = list(map(int, sys.stdin.readline().split()))
ary = sorted(list(map(int, sys.stdin.readline().split())), reverse=True)
bry = sorted(list(map(int, sys.stdin.readline().split())), reverse=True)
mod = 10 ** 9 + 7

# %%

if len(set(ary)) != len(ary) or len(set(bry)) != len(bry):
    print(0)

else:
    ary.append(0)
    bry.append(0)

    cnt = 1
    i = 0
    j = 0
    for num in range(n * m, 0, -1):

        if (num == ary[i]) and (num == bry[j]):
            i += 1
            j += 1

        elif (num == ary[i]) or (num == bry[j]):
            if num == ary[i]:
                cnt *= len(bry[:j])
                i += 1
            else:
                cnt *= len(ary[:i])
                j += 1

        else:
            # na = len(ary[:i])
            # nb = len(bry[:j])
            cnt *= (i * j - (n * m - num))

        cnt = cnt % mod

    print(cnt)
### BUGGY CODE ###

n = int(input())
a = [int(i) for i in input().split()]
def ans(l):
    max = 0
    b = set(l)
    if len(b)==1:
        return 0
    else:
        for i in b:
            s = l.count(i)
            if s>max:
                max = s
        return n/2 - max
if len(set(a)) == 1:
    p = int(n/2)
else:
    p = int(ans(a[::2]) + ans(a[1::2]))
print(p)


### FIXED CODE ###

from collections import Counter
n = int(input())
a = [int(i) for i in input().split()]

if len(set(a)) == 1:
    p = int(n/2)
else:
    b0 = set(a[::2])
    if len(b0)==1:
        q0 = 0
        mark00 = a[0]
        count00, count01 = int(n/2), 0
    else:
        c = Counter(a[::2])
        q0 =  int(n/2) - c.most_common(1)[0][1]
        mark00, mark01 = c.most_common(2)[0][0], c.most_common(2)[1][0]
        count00, count01 = c.most_common(2)[0][1], c.most_common(2)[1][1]

    b1 = set(a[1::2])
    if len(b1)==1:
        q1 = 0
        mark10 = a[1]
        count10, count11 = int(n/2), 0
    else:
        c = Counter(a[1::2])
        q1 =  int(n/2) - c.most_common(1)[0][1]
        mark10, mark11 = c.most_common(2)[0][0], c.most_common(2)[1][0]
        count10, count11 = c.most_common(2)[0][1], c.most_common(2)[1][1]
    if mark00==mark10:
        if count00+count01>count10+count11:
            p = n - (count00+count01)
        else:
            p = n - (count10+count11)
    else:
        p = n - (count00 + count10)

print(p)
### BUGGY CODE ###

N = int(input())

for i in range(1,N+1):
    cnt=0
    t=int(N**0.5+1)
    for x in range(1, t):
        for y in range(1, t):
            for z in range(1, t):
                if i == x**2 + y**2 + z**2 + x*y + y*z + z*x:
                    cnt = cnt+1
    print(cnt)

### FIXED CODE ###

N = int(input())

ans=[0]*(N+1)
t=int(N**0.5+1)
for x in range(1, t):
    for y in range(1, t):
        for z in range(1, t):
            v=x*x+y*y+z*z+x*y+y*z+z*x
            if v<=N: ans[v]+=1
for i in range(1,N+1):
    print(ans[i])
### BUGGY CODE ###

s = input()
if len(s) <= 3:
  print(0)
  exit()

chk = [str((i+1)*2019) for i in range(1000000)]
ans = 0
for i in chk:
    if s.count(i) > 0:
      ans += s.count(i[1:])
      k = i[0]
      for j in range(1,10):
        if j == int(k):
          continue
        ans -= s.count(str(j)+i[1:])
    
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline
s = input().strip()
if len(s) <= 3:
  print(0)
  exit()
c = 0
chk = [0]*2019
for i,si in enumerate(s[::-1]):
  c += int(si)*pow(10,i,2019)
  chk[c%2019] += 1
ans = chk[0]
for i in chk:
  ans += i*(i-1)//2
print(ans)
### BUGGY CODE ###

def gcd(a,b):
    if b==0:return a
    return gcd(b,a%b)

def main():
  if 'get_ipython' not in globals():  
    # For Subsession
    N = int(input())
    A = list(map(int, input().split()))
  else:
    # N = 3
    # A = [7,6,8]
    N = 3
    A = [12,15,18]
    # N = 2
    # A = [1000000000,1000000000]

  x = 0
  for i in range(N):
    tmpA = A[0:i]+A[i+1:]
    tmpAL = len(tmpA)
    if tmpAL== 1:
      tmp = tmpA[0]
    else:
      tmp = gcd(tmpA[0], tmpA[1])
      if tmpAL != 2:
        for j in range(2,tmpAL):
            tmp = gcd(tmp,tmpA[j])

    if tmp > x:
      x = tmp
  
  print(x)
  
main()

### FIXED CODE ###

import functools
import fractions

def main():
  if 'get_ipython' not in globals():  
    # For Subsession
    N = int(input())
    A = list(map(int, input().split()))
  else:
    # N = 3
    # A = [7,6,8]
    N = 3
    A = [12,15,18]
    # N = 3
    # A = [1,1000000000,1000000000]

  AL = [0] * N    
  AR = [0] * N
  for i in range(N):
    if i != 0:
      AL[i] = fractions.gcd(AL[i-1],A[i])
    else:
      AL[i] = A[i]
    j = N - i - 1
    if j!= N - 1:
      AR[j] = fractions.gcd(AR[j+1],A[j])
    else:
      AR[j] = A[j]
      
  if 'get_ipython' in globals():   
    print(AL)
    print(AR)
  
  x = 0
  for i in range(N):
    if i == 0:
      tmp = AR[i+1]
    elif i == N - 1:
      tmp = AL[i-1]
    else:
      tmp = fractions.gcd(AL[i-1],AR[i+1])
    if tmp > x: x = tmp
  
  print(x)
    
main()
### BUGGY CODE ###

n,q=map(int,input().split())
s=str(input())
grid = []
for i in range(q):
    array = list(map(int, input().strip().split()))
    grid.append(array)

line = []
for i in range(n-1):
    if (s[i]=="A")&(s[i+1]=="C"): 
        line.append(1)
    else:
        line.append(0)
    
for i in range(0,q):
    target = line[grid[i][0]-1:grid[i][1]-1]
    print(sum(target))

### FIXED CODE ###

import numpy as np

n,q=map(int,input().split())
s=str(input())

line = np.zeros([n,])
count = 0
for i in range(1,n):
    if (s[i-1:i+1]=="AC"): 
        count += 1
    line[i]=count 
        
for i in range(q):
    l,r = map(int,input().split())
    target = line[r-1] - line[l-1]
    print(int(target))
### BUGGY CODE ###

import math
N=int(input())
ans=list()
for i in range(1,N+1):
    tmp=0
    tgt=int(math.sqrt(i/2)+1)
    ##print('a',tgt)
    for j in range(1,tgt):
        for k in range(j,tgt):
            for h in range(k,tgt):
                if h**2+j**2+k**2+h*j+j*k+k*h==i:
                    if j==k==h:
                        tmp+=1
                    elif j==k or k ==h:
                        tmp+=3
                    else:
                        tmp+=6
    ans.append(tmp)
for i in ans:
    print(i)

### FIXED CODE ###

N=int(input())
a=[0]*10**4
for j in range(1,101):
    for k in range(1,101):
        for h in range(1,101):
            tmp=h**2+j**2+k**2+h*j+j*k+k*h
            if tmp<=10000:
                a[tmp-1]+=1
for i in range(N):
    print(a[i])
### BUGGY CODE ###

S = input()
Q = int(input())

for i in range(Q):
    Query_tmp = list(map(str, input().split()))
    
    if Query_tmp[0] == "1":
        S = S[::-1]
    else:
        if Query_tmp[1] == "1":
            S = Query_tmp[2] + S
        else:
            S = S + Query_tmp[2]

print(S)

### FIXED CODE ###

from collections import deque

S = input()
Q = int(input())

reverse = 1 #reverse == 1 -> 正常, reverse == -1 -> 逆から

d = deque(S)

for i in range(Q):
    Query_tmp = list(map(str, input().split()))
    
    if Query_tmp[0] == "1":
        reverse *= -1
        # S = S[::-1]
    else:
        Ci = Query_tmp[2]

        if Query_tmp[1] == "1":
            if reverse == 1:
                d.appendleft(Ci)
            else:
                rev_Ci = Ci[::-1]
                d.append(rev_Ci)
        else:
            if reverse == 1:
                d.append(Ci)
            else:
                rev_Ci = Ci[::-1]
                d.appendleft(rev_Ci)
    
    # if reverse == 1:
    #     print(S)
    # else:
    #     print(S[::-1])

if reverse == -1:
    d.reverse()

print("".join(d))
### BUGGY CODE ###

import math

N = int(input())
ans = 0
mod = 10**9+7

kai = math.factorial(N)


for i in range(1,kai+1):
    if kai % i == 0:
        ans += 1

print(ans % mod)


### FIXED CODE ###

N = int(input())
count = [1]*(N+1)
ans = 1
mod = 10**9+7

for i in range(2,N+1):
    wari = i
    for w in range(2,i+1):
        while wari % w == 0:
            count[w] += 1
            wari /= w

for i in range(N+1):
    ans *= count[i]

print(ans % mod)
### BUGGY CODE ###


mod=10**9+7
n, m = map(int, input().split())
ai=[]

for i in range(m):
    ai.append(int(input()))
#print(ai)

dp=[]
for i in range(n+1):
    dp.append(0)

dp[0]=1
if 1 in ai:
    dp[1]=0
else:
    dp[1]=1

for i in range(2,n+1):
    if i in ai:
        continue
    dp[i]=(dp[i-1]+dp[i-2])%mod

#print(dp)
print(dp[n])


### FIXED CODE ###


mod=10**9+7
n, m = map(int, input().split())
ai={}

for i in range(m):
    ai.setdefault(int(input()), 0)
#print(ai)

dp={}
for i in range(n+1):
    dp.setdefault(i, 0)

dp[0]=1
if 1 in ai:
    dp[1]=0
else:
    dp[1]=1

for i in range(2,n+1):
    if i in ai:
        continue
    dp[i]=(dp[i-1]+dp[i-2])%mod

#print(dp)
print(dp[n])
### BUGGY CODE ###

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

A.sort()
total = 1
flag = 9
for i in range(N-1,-1,-1):
  total *= A[i]
  if total > 10**18:
    flag = 0
    break
  elif min(A) == 0:
    flag = 1
    break
  
if flag == 0:
  print(-1)
elif flag == 1:
  print(0)
else:
  print(total)
    

### FIXED CODE ###

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

A.sort()
B = list(set(A))

total = 1
flag = 9
for i in range(len(B)):
  total *= B[i]**A.count(B[i])
  if total > 10**18:
    flag = 0
    break
  elif min(A) == 0:
    flag = 1
    break
  
if flag == 0:
  print(-1)
elif flag == 1:
  print(0)
else:
  print(total)
### BUGGY CODE ###

R,G,B,N = map(int, input().split())
count = 0
for r in range(0,N+1) :
    rn = r * R
    if rn == N :
        count += 1
    elif rn > N :
        pass
    else :
        for g in range(0, N+1) :
            gn = g * G
            if rn + gn == N :
                count += 1
            elif gn > N :
                pass
            else :
                for b in range(0, N + 1):
                    bn = b * B
                    if rn + gn + bn == N:
                        count += 1
print(count)

### FIXED CODE ###

R,G,B,N = map(int, input().split())
count = 0
for r in range(N // R + 1) :
    for g in range((N - r*R) // G + 1) :
        if (N - r*R - g*G) %B == 0 :
            count += 1
print(count)
### BUGGY CODE ###

N,M,L=map(int,input().split())
ABC=[map(int,input().split()) for _ in range(M)]
Q=int(input())
ST=[list(map(int,input().split())) for _ in range(Q)]

E=[[-1]*N for _ in range(N)]
for a,b,c in ABC:
    E[a-1][b-1]=c
    E[b-1][a-1]=c

def warshall_floyd(V,E):
    for k in range(V):
        for i in range(V):
            for j in range(V):
                if E[i][j] == -1:
                    if (E[i][k] != -1) and (E[k][j] != -1):
                        E[i][j]=E[i][k]+E[k][j]
                elif E[i][k] == -1 or E[k][j] == -1:
                    pass
                else:
                    E[i][j]=min(E[i][j],E[i][k]+E[k][j])
    return E

E=warshall_floyd(N,E)
for i in range(N):
    E[i][i]=-1
E=[[1 if __<= L and __!= -1 else -1 for __ in _] for _ in E]
E=warshall_floyd(N,E)


for s,t in ST:
    if E[s-1][t-1]>0:
        print(E[s-1][t-1]-1)
    else:
        print(-1)

### FIXED CODE ###

from scipy.sparse.csgraph import csgraph_from_dense
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import floyd_warshall
import numpy as np
N,M,L=map(int,input().split())
A=[0]*M
B=[0]*M
C=[0]*M
for i in range(M):
    A[i],B[i],C[i] = map(int,input().split())
    A[i] -=1
    B[i] -=1
Q=int(input())
ST=[list(map(int,input().split())) for _ in range(Q)]


G = csr_matrix((C, (A, B)), shape=(N, N))
d = floyd_warshall(G, directed=False)
G=np.full((N,N), np.inf)
G[d<=L]=1
G = csr_matrix(G)
E = floyd_warshall(G, directed=False)

for s,t in ST:
    if E[s-1][t-1]==float('inf'):
        print(-1)
    else:
        print(int(E[s-1][t-1]-1))
### BUGGY CODE ###

s = input().split()

n = int(s[0])
m = int(s[1])

ll = [set() for j in range(n + 1)]
sl = set()

s1 = {1}
s2 = set()


for i in range(m):
    t = input().split()
    sl.add(int(t[0]))
    sl.add(int(t[1]))
    ll[int(t[0])].add(int(t[1]))
    ll[int(t[1])].add(int(t[0]))


if sum(sl) < int(((n + 1) * n ) / 2):
    print("No")
else:
    count = 0
    mydict = {}
    out = 0

    while count < n:
        s2.clear()
        for i in sl:
            if len(s1 & ll[i]) != 0:
                s3 = list(s1 & ll[i])
                mydict.setdefault(i,s3[0])
                s2.add(i)
                count += 1
        sl = sl - s2
        s1 = s2.copy()

    print("Yes")
    for i in range(2,n+1):
        print(mydict[i])

### FIXED CODE ###

import collections

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

coriddorList = [set() for i in range(n+1)]
deepList = [-1 for i in range(n+1)]


for i in range(m):
    a,b = list(map(int,input().split()))
    coriddorList[a].add(b)
    coriddorList[b].add(a)

checkList = [0] * (n + 1)
ansList = [0] * (n + 1)
checkList[1] = 1
q = collections.deque()
q.appendleft(1)

while len(q) > 0:
    value = q.pop()
    for k in coriddorList[value]:
        if checkList[k] == 0:
            checkList[k] = 1
            ansList[k] = value
            q.appendleft(k)

print("Yes")
for i in range(2,n+1):
    print(ansList[i])
### BUGGY CODE ###

from collections import Counter 

n = int(input())
a = sorted(map(int, input().split()))
adict = Counter(a)

for i in a:
    if i in adict:
        tmp = set([])
        for j in list(adict):
            if j % i == 0 and j != i:
                del adict[j]
print(list(adict.values()).count(1))


### FIXED CODE ###

n = int(input())
a = sorted(map(int, input().split()))

cnt = [0] * (a[-1] + 1)
for i in a:
    cnt[i] += 1
for i in set(a):
    if cnt[i] >= 1:
        for j in range(i * 2, a[-1] + 1, i):
            cnt[j] = 0
print(cnt.count(1))
### BUGGY CODE ###

n, m, q = map(int,input().split())
ways = [[0 for i in range(n+1)] for j in range(n+1)]
for i in range(m):
    l,r = map(int,input().split())
    ways[l][r] += 1

sgways = [[0 for i in range(n+1)] for j in range(n+1)]
for i in range(1,n+1):
    for j in range(i,n+1):
        for k in range(i,j+1):
            sgways[i][j] += ways[k][j]


ans = [[0 for i in range(n+1)] for j in range(n+1)]
for i in range(1,n+1):
    for j in range(i,n+1):
        for k in range(i,j+1):
            ans[i][j] += sgways[i][k]
for i in range(q):
    pi,qi = map(int,input().split())
    print(ans[pi][qi])


### FIXED CODE ###

n, m, q = map(int,input().split())
ways = [[0 for i in range(n+2)] for j in range(n+2)]
for i in range(m):
    l,r = map(int,input().split())
    ways[l][r] += 1

sgways = [[0 for i in range(n+2)] for j in range(n+2)]
for j in range(1,n+1):
    for i in range(j):
        sgways[j-i][j] = sgways[j-i+1][j] +ways[j-i][j]

ans = [[0 for i in range(n+1)] for j in range(n+1)]
for i in range(1,n+1):
    for j in range(i,n+1):
        ans[i][j] = ans[i][j-1]+sgways[i][j]
for i in range(q):
    pi,qi = map(int,input().split())
    print(ans[pi][qi])
### BUGGY CODE ###

import numpy as np

n = int(input())

div = np.ones(n + 1, dtype=np.int32)

for i in range(2, n + 1):
    div[i::i] += 1

print((div * np.arange(n + 1)).sum())

### FIXED CODE ###

n = int(input())
div = [1] * (n + 1)

for i in range(2, n + 1):
    cnt = 1
    while i * cnt <= n:
        div[i * cnt] += 1
        cnt += 1
print(sum([x * y for x, y in enumerate(div)]))