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

import sys
input=sys.stdin.readline

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

def make_divisors(n, ar):
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            ar[i] += 1
            if i != n // i:
                ar[n//i] += 1

tmp = [0]*(N+1)
b = [0]*N
ball_num = 0
ball_box = []
for i in reversed(range(N)):
    if a[i] == 0:
        if (tmp[i+1]%2) == 0:
            continue
        else:
            ball_box.append(i+1)
            ball_num += 1
            make_divisors(i+1, tmp)
    elif a[i] == 1:
        if (tmp[i+1]%2) == 0:
            ball_box.append(i+1)
            ball_num += 1
            make_divisors(i+1, tmp)
        else:
            continue

print(ball_num)
if ball_num != 0:
    print(*ball_box)

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
 
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors
 
 
tmp = [0]*(N+1)
b = [0]*N
ball_num = 0
ball_box = []
for i in reversed(range(N)):
    if a[i] == 0:
        if (tmp[i+1]%2) == 0:
            continue
        else:
            ball_box.append(i+1)
            ball_num += 1
            val = make_divisors(i+1)
            for elms in val:
                tmp[elms] += 1
    elif a[i] == 1:
        if (tmp[i+1]%2) == 0:
            ball_box.append(i+1)
            ball_num += 1
            val = make_divisors(i+1)
            for elms in val:
                tmp[elms] += 1
        else:
            continue
 
print(ball_num)
if ball_num != 0:
    print(*ball_box)
### BUGGY CODE ###

num = int(input())
i = 1
while True:
    bef = sum(range(1,i))
    i += 1
    aft = sum(range(1,i))
    if bef < num <= aft:
        print(i-1)
        break


### FIXED CODE ###

num = int(input())
i = 1
bef = 0
while True:
    bef += i-1
    aft = bef + i
    if bef < num <= aft:
        print(i)
        break
    i += 1
### BUGGY CODE ###

import sys
H, N = map(int, input().split())
AB = [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
dp = [float('inf') for _ in range(H+1)]

for i, ab in enumerate(AB):
    a, b = ab
    for j in range(H // AB[i][0] + 2):
        dp[min(AB[i][0] * j, H)] = min(dp[min(AB[i][0] * j, H)], AB[i][1] * j)
        j += 1

for h in range(H):
    for n in range(N):
        for j in range((H - h) // AB[n][0] + 2):
            dp[min(h + AB[n][0] * j, H)] = min(dp[min(h + AB[n][0] * j, H)], dp[h] + AB[n][1] * j)
print(dp[-1])

### FIXED CODE ###

import sys

H, N = map(int, input().split())
AB = [list(map(int, sys.stdin.readline().split())) for _ in range(N)]

dp = [0 for _ in range(H + max(AB, key=lambda x: x[0])[0])]
for h in range(1, len(dp)):
    dp[h] = min(dp[h-a] + b for a, b in AB)

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

x,y = map(int,input().split())
t = list(map(int,input().split()))
ans = 1000000000000000000000000000000
for i in range(x-y+1):
    hani = t[i:i+y]
    if hani[0] <= 0 and 0 <= hani[-1]:
        ans = min(ans, abs(hani[-1]*2)+abs(hani[0]), abs(hani[-1])+abs(hani[0]*2))
    elif hani[-1] <= 0:
        ans = min(ans, abs(hani[0]))
    elif 0 <= hani[0]:
        ans = min(ans, abs(hani[-1]))
print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
X = list(map(int, input().split()))
ans = float("inf")
for left in range(0, N-K+1):
    right = left+K
    minus = 0
    plus = 0
    if X[left] < 0:
        minus = min(minus, X[left])
    if X[right-1] > 0:
        plus = max(plus, X[right-1])
    ans = min(ans, 2*abs(minus)+plus, abs(minus)+2*plus)
 
print(ans)
### BUGGY CODE ###

import sys
input = sys.stdin.readline

N, K = map(int, input().split())
p = list(map(int, input().split()))

ans = 0

for i in range(N - K + 1):
    tmp = sum(p[i:i + K])
    if ans < tmp:
        ans = tmp

print((ans + K) / 2)


### FIXED CODE ###

import sys
import numpy as np
input = sys.stdin.readline

N, K = map(int, input().split())
p = np.array(list(map(int, input().split())))
c = np.cumsum(p)

ans = c[K-1]

for i in range(N - K):
    tmp = c[i+K] - c[i]
    ans = max(ans, tmp)

print((ans + K) / 2)
### BUGGY CODE ###

cards=input()
list=cards.split()
a=int(list[0])
b=int(list[1])
c=int(list[2])
k=int(list[3])
i,j,l=(0,0,0)
min=c*(-1)
while i<=a:
    while j<=b:
        while l<=c:
            if i+j+l==k:
              new=i*1+j*0+l*(-1)
              if new>min:
                  min=new
            l=l+1
        l=0
        j=j+1
    i=i+1
    l=0
    j=0
print(min)


### FIXED CODE ###

cards=input()
new=cards.split()
a=int(new[0])
b=int(new[1])
c=int(new[2])
k=int(new[3])
if a>k:
    print(k)
else:
    if a+b>k:
        print(a)
    else:
        sum=a+(k-(a+b))*(-1)
        print(sum)
### BUGGY CODE ###

s = input()
init_len = len(s)
tmp_s_len = 0
while tmp_s_len != len(s):
    tmp_s_len = len(s)
    s = s.replace("01","").replace("10","")
    continue
res = init_len - tmp_s_len
print(res)


### FIXED CODE ###

s = input()
cnt_zero = 0
cnt_one = 0
for letter in s:
    if letter == "0":
        cnt_zero += 1
    else:
        cnt_one += 1
res = min(cnt_zero, cnt_one) * 2
print(res)
### BUGGY CODE ###

N = int(input())
cnt = 0
for a in range(1,N+1):
  for b in range(1,N+1):
    if a*b >= N:
      break
    cnt+=1
print(cnt)

### FIXED CODE ###

N = int(input())
cnt = 0
for a in range(1,N+1):
  b = N // a
  if a * b == N:
    cnt = cnt + b - 1
  else:
    cnt = cnt + b
print(cnt)
### BUGGY CODE ###

N, K = map(int, input().split())
def gcd(a, b):
    if a < b:
        a, b = b, a
    while b != 0:
        r = a%b
        a = b
        b = r
    return a
gcdlist = list()
for i in range(2, K+1):
    for j in range(1, i):
        gcdlist.append(gcd(i, j))
        gcdlist.append(gcd(i, j))
for i in range(1, K+1):
    gcdlist.append(i)

for i in range(3, N+1):
    gcdnew = list()
    for j in range(1, K+1):
        for k in range(len(gcdlist)):
            gcdnew.append(gcd(j, gcdlist[k]))
    gcdlist = gcdnew
print(sum(gcdlist))

### FIXED CODE ###

N, K = map(int, input().split())
numgcd = [0]*(K+1)
sumgcd = 0
mod = 10**9+7
for i in range(1, K+1)[::-1]:
    numgcd[i] = pow(K//i, N, mod)
    count = 2
    while count*i <= K:
        numgcd[i] -= numgcd[count*i]
        count += 1
    sumgcd += numgcd[i]*i
print(sumgcd%mod)
### BUGGY CODE ###

s=' '+input()
t=' '+input()
dp=[]
for i in range(len(s)):
    sub_list=[]
    for j in range(len(t)):
        sub_list.append('')
    dp.append(sub_list)
for i in range(1,len(s)):
    for j in range(1,len(t)):
        if s[i]==t[j]:
            dp[i][j]=dp[i-1][j-1]+s[i]
        else:
            if len(dp[i-1][j])>len(dp[i][j-1]):
                dp[i][j]=dp[i-1][j]
            else:
                dp[i][j]=dp[i][j-1]
print(dp[len(s)-1][len(t)-1])


### FIXED CODE ###

import sys
input=sys.stdin.readline
s=' '+input().rstrip()
t=' '+input().rstrip()
m=len(s)-1
n=len(t)-1
dp=[[0]*(n+1) for i in range(m+1)]
for i in range(1,m+1):
    for j in range(1,n+1):
        if s[i]==t[j]:
            dp[i][j]=dp[i-1][j-1]+1
        else:
            dp[i][j]=max(dp[i-1][j],dp[i][j-1])
ans=''
while m>0 and n>0:
    if dp[m][n]==dp[m][n-1]:
        n-=1
    elif dp[m][n]==dp[m-1][n]:
        m-=1
    elif dp[m][n]==dp[m-1][n-1]+1:
        ans=s[m]+ans
        m-=1
        n-=1
print(ans)
### BUGGY CODE ###

import heapq
[N,L] = [int(x) for x in input().split()]
A = [[int(x),int(i)] for i,x in enumerate(input().split())]
heapq.heapify(A)
ANS = [10**9+1]*N
for j in range(N):
    a = heapq.heappop(A)
    for i in range(L):
        try :
            if ANS[a[1]+i] == 10**9+1 : ANS[a[1]+i] = str(a[0])
        except IndexError : continue
print(" ".join(ANS[L-1:]))

### FIXED CODE ###

def ascend(a,b):
    mini = min(A[a:a+L])
    ans[a] = mini
    for i in range(a+1,b):
        if A[i+L-1] <= mini : mini = A[i+L-1]
        elif A[i-1] == mini : mini = min(A[i:i+L])
        ans[i] = mini

def descend(a,b):
    mini = min(A[b-1:b+L-1])
    ans[b-1] = mini
    for i in range(b-2,a-1,-1):
        if A[i] <= mini : mini = A[i]
        elif A[i+L] == mini: mini = min(A[i:i+L])
        ans[i] = mini
    
[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = [None]*(N-L+1)
count = 0;
if N > 10 ** 4:
    for i in range(100):
        if A[i+1] > A[i] : count += 1
    if count > 80 : descend(0, N-L+1)
    else : ascend(0,N-L+1)
else :
    ascend(0, N-L+1)
for i in ans[:-1] : print(i, end=" ")
print(ans[-1])
### BUGGY CODE ###

from itertools import *

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

if n>=m:
    print(0)
else:
    for i in range(n-1):
        dis.remove(max(dis))
    print(sum(dis))


### FIXED CODE ###

from itertools import *

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

if n>=m:
    print(0)
else:
    for i in range(n-1):
        dis.pop(-1)
    print(sum(dis))
### BUGGY CODE ###

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

mod = 1000000007

l = 1

def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)

def lcm(a, b):
    return a * b // gcd(a, b)

for i in range(n):
    l = lcm(l, a[i])

ans = 0
for i in range(n):
    ans += l // a[i]
    ans %= mod

print(ans)

### FIXED CODE ###

from fractions import gcd
n = int(input())
a = list(map(int, input().split()))

mod = 1000000007

l = 1

for i in range(n):
    l = l * a[i] // gcd(l, a[i])

ans = 0
for i in range(n):
    ans += l // a[i]

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

# -*- coding: utf-8 -*-
import itertools
N,M,Q=map(int,input().split())
abcd=[]
for _ in range(Q):
    abcd.append(list(map(int,input().split())))
Abase=[]
for a in range(1,M+1):
    Abase.append(a)
Abase=Abase*N
A=set(itertools.combinations(Abase,N))
A=list(A)
A2=[sorted(x) for x in A]
ans=0
for i in A2:
    temp=0
    for j in abcd:
        if i[j[1]-1]-i[j[0]-1]==j[2]:
            temp=temp+j[3]
    if temp>=ans:
        ans=temp
print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-
import itertools
N,M,Q=map(int,input().split())
abcd=[]
for _ in range(Q):
    abcd.append(tuple(map(int,input().split())))
Abase=[]
for a in range(1,M+1):
    Abase=Abase+[a]
A=set(itertools.combinations_with_replacement(Abase,N))
ans=0
for i in A:
    temp=0
    for j in abcd:
        if i[j[1]-1]-i[j[0]-1]==j[2]:
            temp=temp+j[3]
    if temp>=ans:
        ans=temp
print(ans)
### BUGGY CODE ###

INFTY = 10**5
P = [1 for _ in range(INFTY)]
P[0]=0
P[1]=0
for i in range(2,int(INFTY**0.5)+1):
    for j in range(i*i,INFTY,i):
        P[j] = 0
Q = []
for i in range(INFTY):
    if P[i]==1:
        Q.append(i)
N,M = map(int,input().split())
y = 1
for q in Q:
    if M%q==0:
        y = 0
        break
if N==1:
    x = M
elif y==1:
    x = 1
else:
    b = M//N
    for i in range(b,0,-1):
        if M%i==0:
            x = i
            break
print(x)

### FIXED CODE ###

N,M = map(int,input().split())
k = 1
for i in range(1,int(M**0.5)+1):
    if M%i==0:
        a = i
        b = M//i
        k1 = 1
        k2 = 1
        if b>=N:
            k1 = a
        if a>=N:
            k2 = b
        k = max(k,k1,k2)
print(k)
### BUGGY CODE ###

def factorize(x):
    p = 2
    f = {}
    while x>=p*p:
        if x%p==0: f[p]=0
        while x%p==0:
            f[p]+=1
            x//=p
        p+=1
    if x>1: f[x]=1
    return f

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

F = {0:0}

for a in A:
    for f in set(factorize(a)):
        if f not in F: F[f] = 0
        F[f] += 1

m = max(F.values())
if m<=1:
    print('pairwise coprime')
elif m<N:
    print('setwise coprime')
else:
    print('not coprime')
    


### FIXED CODE ###

def factorize(x):
    f = set()
    if x%2==0: f.add(2)
    while x%2==0: x//=2
    
    p = 3
    while x>=p*p:
        if x%p==0: f.add(p)
        while x%p==0: x//=p
        p+=2
    if x>1: f.add(x)
    return f

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

F = [0]*(10**6+5)

for a in A:
    for f in factorize(a):
        F[f] += 1

m = max(F)
if m<=1:
    print('pairwise coprime')
elif m<N:
    print('setwise coprime')
else:
    print('not coprime')
### BUGGY CODE ###

n = int(input())
dList = list(map(int,input().split()))
result = []

for i in range(n):
  if i % 2 == 0:
   result.insert(0,dList[i])
  else:
   result.append(dList[i])

if n % 2 == 0:
  print(' '.join([str(result[i]) for i in range(len(result)-1,-1,-1)]))
else:
  print(' '.join([str(i) for i in result]))



### FIXED CODE ###

from collections import deque
n = int(input())
dList = list(map(int,input().split()))
result = deque()

for i in range(n):
  if (i % 2 == 0 and n % 2 == 0) or (i % 2 != 0 and n % 2 != 0):
   result.append(dList[i])
  else:
   result.appendleft(dList[i])

for i in result:
  print(i,end=" ")

print()
### BUGGY CODE ###

n=int(input())
l=list(map(int,input().split()))
x=0
flg=0
while(x<n):
    j=x+1
    while(j<n):
        if(l[j]<l[x]-1):
            flg=1
            break
        j+=1
    x+=1
if(flg==0):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))
x=[]
i=0
flag=0
for i in range(n-1,0,-1):
    if(l[i]<l[i-1]):
        if(l[i-1]-1<=l[i]):
            l[i-1]-=1
        else:
            flag=1
if(flag==0):
    print("Yes")
else:
    print("No")
### BUGGY CODE ###

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

B = [list(map(int, input().split())) for _ in range(M)][::-1]

S = []
pt = []
cnt = 0
for pair in B:
    d = []
    for x in pair:
        for j, s in enumerate(S):
            if x in s:
                d.append(j)

    if len(d) <= 0:
        pt.append(1)
        S.append(set(pair))
    elif len(d) == 1:
        pt.append(len(S[d[0]]))
        S[d[0]].add(pair[0])
        S[d[0]].add(pair[1])
    else:
        if d[0] == d[1]:
            pt.append(0)
        else:
            pt.append(len(S[d[0]]) * len(S[d[1]]))
            S[d[0]] = S[d[0]].union(S[d[1]])
            del S[d[1]]

cnt = 0
for x in pt[::-1]:
    cnt += x
    print(cnt)


### FIXED CODE ###

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

pt = []
G = [[None, 1] for x in range(N+1)]

def find(x):
    n = G[x]
    c = []
    while not n[0] is None:
        c.append(n)
        n = n[0]
    for ci in c:
        ci[0] = n
    return n

cnt = 0
while len(B):
    x, y = B.pop()
    wx = find(x)
    wy = find(y)
    if wx is wy:
        pt.append(0)
    else:
        pt.append(wx[1] * wy[1])
        wx[1] += wy[1]
        wy[0] = wx

    #print(G)

cnt = 0
for _ in range(M):
    cnt += pt.pop()
    print(cnt)
### BUGGY CODE ###

s=input()
n=len(s)
r=""
c=0
for i in range (n):
    if s[i]=='?':
        r+="D"
    else:
        r+=s[i]
print(r)

### FIXED CODE ###

s=input()
print(s.replace("?", "D"))
### BUGGY CODE ###

from itertools import accumulate


class Bit:
    def __init__(self, n):
        self.size = n
        self.tree = [0] * (n + 1)

    def sum(self, i):
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s

    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i

    def reset(self):
        self.tree = [0] * (self.size + 1)


def solve(n, aaa):
    t = n * (n + 1) // 4
    alt = sorted(set(aaa))
    l, r = 0, len(alt) - 1
    bt = Bit(n * 2)
    while l <= r:
        m = (l + r) // 2
        am = alt[m]
        ccc = accumulate(1 if a - am >= 0 else -1 for a in aaa)
        bt.add(n, 1)
        right_order = 0
        for p in ccc:
            p += n
            right_order += bt.sum(p)
            bt.add(p, 1)
        if right_order >= t:
            l = m + 1
        else:
            r = m - 1
        bt.reset()
    return alt[r]


n = int(input())
aaa = list(map(int, input().split()))
print(solve(n, aaa))


### FIXED CODE ###

from itertools import accumulate


class Bit:
    def __init__(self, n):
        self.size = n
        self.tree = [0] * (n + 1)

    def sum(self, i):
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s

    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i

    def reset(self):
        self.tree = [0] * (self.size + 1)


def solve(n, aaa):
    t = n * (n + 1) // 4
    alt = sorted(set(aaa))
    l, r = 0, len(alt) - 1
    bt = Bit(n * 2)
    while l <= r:
        m = (l + r) // 2
        am = alt[m]
        ccc = accumulate(1 if a - am >= 0 else -1 for a in aaa)
        bt.add(n, 1)
        right_order = 0
        for p in ccc:
            p += n
            right_order += bt.sum(p)
            bt.add(p, 1)
        if right_order >= t:
            l = m + 1
        else:
            r = m - 1
        bt.reset()
    return alt[r]


n = int(input())
aaa = list(map(int, input().split()))
print(solve(n, aaa))
### BUGGY CODE ###

L, R = map(int, input().split())

ans = 2018
for i in range(L, R):
    for j in range(i+1, R+1):
        cnt = i*j % 2019
        if cnt == 0:
            ans = 0
            break
        ans = min(cnt, ans)

print(ans)


### FIXED CODE ###

L, R = map(int, input().split())

ans = 2018
for i in range(L, R):
    for j in range(i+1, R+1):
        cnt = i*j % 2019
        if cnt == 0:
            print(0)
            exit()
        ans = min(cnt, ans)

print(ans)
### BUGGY CODE ###

N, K, Q = map(int, input().split())
A_lis = [int(input()) for _ in range(Q)]

score = [K]*N
for A in A_lis:
    for i in range(len(score)):
        if i!=A-1:
            score[i]-=1
for i in range(len(score)):
    if score[i]>0:
        print("Yes")
    else:
        print("No")


### FIXED CODE ###

N, K, Q = map(int, input().split())
A_lis = [int(input()) for _ in range(Q)]
#A_lis.sort()

B_lis = [int(K-Q)]*N
for A in A_lis:
    B_lis[A-1]+=1
for B in B_lis:
    if B>0:
        print("Yes")
    else:
        print("No")
### BUGGY CODE ###

n,w = map(int,input().split())
ww = [0]*n
vv = [0]*n
dp = [[0]*(w+1) for _ in range(n+1)]

for i in range(n):
  ww[i],vv[i] = map(int,input().split())      
  
for i in range(1,n+1):
  for j in range(1,w+1):
    dp[i][j] = dp[i-1][j]
    if j - ww[i-1] >= 0:
      dp[i][j] = max(dp[i][j], \
                     dp[i-1][j-ww[i-1]] + vv[i-1])        

print(dp[-1][-1])      

### FIXED CODE ###

n,w = map(int,input().split())
ww = [0]*n
vv = [0]*n
dp = [[0]*(w+1) for _ in range(n+1)]

for i in range(n):
  ww[i],vv[i] = map(int,input().split())      
  
for i in range(1,n+1):
  for j in range(1,w+1):
    dp[i][j] = dp[i-1][j]
    if j - ww[i-1] >= 0:
      dp[i][j] = max(dp[i][j], \
                     dp[i-1][j-ww[i-1]] + vv[i-1])        

print(dp[-1][-1])
### BUGGY CODE ###

N,P=map(int,input().split())
S=input()
if P==2 or P==5:
    x=0
    for j in range(N):
        if int(S[j])%P==0:
            x+=j+1
    print(x)
else:
    A=[0]*P
    a=0
    b=1
    for i in range(N):
        a=(a+int(S[(N-1-i)])*(b%P))%P
        A[a]+=1
        b=b*10
    x=A[0]
    for k in range(P):
        x+=int(A[k]*(A[k]-1)/2)
    print(x)
    

### FIXED CODE ###

N,P=map(int,input().split())
S=input()
if P==2 or P==5:
    x=0
    for j in range(N):
        if int(S[j])%P==0:
            x+=j+1
    print(x)
else:
    A=[0]*P
    a=0
    b=1
    for i in range(N):
        a=(a+int(S[(N-1-i)])*b)%P
        A[a]+=1
        b=(b*10)%P
    x=A[0]
    for k in range(P):
        x+=int(A[k]*(A[k]-1)/2)
    print(x)
### BUGGY CODE ###


# coding: utf-8

# In[3]:


N,K,Q=map(int,input().split())


# In[6]:


A = []
for i in range(Q):
    A.append(int(input()))


# In[10]:


for i in range(N):
    score = K-Q + A.count(i+1)
    if score > 0:
        print("Yes")
    else:
        print("No")


### FIXED CODE ###


# coding: utf-8

# In[11]:


N,K,Q=map(int,input().split())


# In[13]:


ans = [0] * N
for i in range(Q):
    ans[int(input())-1]+=1


# In[14]:


for i in range(N):
    score = K-Q + ans[i]
    if score > 0:
        print("Yes")
    else:
        print("No")
### BUGGY CODE ###

#import numpy as np

N = int(input())
A = list(map(int, input().split()))
# a,b=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
# c=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
# s=[list(map(int,list(input()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

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

##一次元配列の初期化
#a=[0]*5
#[i for i in range(100) if i%2==1] #奇数のみ
##二次元配列の初期化
#mod = np.array([[-1 for i in range(N)] for i in range(N)])
#A = list(set(A))
A = sorted(A)#わるほう

kouho = [x for x in set(A) if A.count(x) == 1]
target = list(kouho.copy())
            
for i in range(len(A)):
    if target == []:
        break
    maxN = int(max(target)/A[i])
    for n in range(2,maxN+1):
        if A[i]*n in kouho:
            kouho.remove(A[i]*n)
            #print(A[i]*n)
target = list(kouho.copy())
        
print(len(target))

### FIXED CODE ###

#import numpy as np

N = int(input())
A = list(map(int, input().split()))
A.sort()#わるほう

#kouho = sorted([x for x in set(A) if A.count(x) == 1])
#maxA = 10**5

#target = kouho[:]
maxA = A[-1]
work=[0]*(A[-1]+1)

for i in range(len(A)):
    if work[A[i]]<=1:
        maxN = int(maxA/A[i])
        for n in range(1,maxN+1):
            buf = A[i]*n
            #remove_list.append(buf)
            work[buf]+=1
                #print(A[i]*n)

#target = kouho[:]
#kouho = list(set(kouho) - set(remove_list))

sm=0
for s in A:
    if work[s]==1: sm+=1
print(sm)

#print(len(kouho))
### BUGGY CODE ###

import sys
input = sys.stdin.readline
from collections import Counter, defaultdict


def read():
    H, W, M = map(int, input().strip().split())
    HW = []
    for i in range(M):
        h, w = map(int, input().strip().split())
        HW.append((h, w))
    return H, W, M, HW


def solve(H, W, M, HW):
    G = [defaultdict(bool) for i in range(H+1)]
    hcount = Counter()
    wcount = Counter()
    for h, w in HW:
        G[h][w] = True
        hcount[h] += 1
        wcount[w] += 1
    hm = hcount.most_common()
    wm = wcount.most_common()
    hmax = hm[0][1]
    wmax = wm[0][1]
    
    ans = 0
    i = 0
    for hk, hv in hm:
        if hv  < hmax:
            break
        for wk, wv in wm:
            if wv < wmax:
                break
            ans = max(ans, hmax + wmax - G[hk][wk])
    return ans


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))


### FIXED CODE ###

import sys
input = sys.stdin.readline
from collections import Counter, defaultdict


def read():
    H, W, M = map(int, input().strip().split())
    HW = []
    for i in range(M):
        h, w = map(int, input().strip().split())
        HW.append((h, w))
    return H, W, M, HW


def solve(H, W, M, HW):
    hcount = Counter()
    wcount = Counter()
    for h, w in HW:
        hcount[h] += 1
        wcount[w] += 1
    hm = hcount.most_common()
    wm = wcount.most_common()
    hmax = hm[0][1]
    wmax = wm[0][1]
    hn = len([1 for k, v in hcount.items() if v == hmax])
    wn = len([1 for k, v in wcount.items() if v == wmax])
    m = hn * wn
    for h, w in HW:
        if hcount[h] == hmax and wcount[w] == wmax:
            m -= 1
    if m == 0:
        return hmax + wmax - 1
    return hmax + wmax


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))
### BUGGY CODE ###

N = int(input())
A_list = list(map(int, input().split()))
sorted_A_list = sorted(A_list)
sorted_A_list
for a in sorted_A_list:
    print(A_list.index(a) + 1, end=' ')


### FIXED CODE ###

N = int(input())
A_list = list(map(int, input().split()))
index_add_A_list = []
for i, A in enumerate(A_list):
    index_add_A_list.append([i, A])
sorted_index_add_A_list = sorted(index_add_A_list, key=lambda x: x[1])
for a in sorted_index_add_A_list:
    print(a[0] + 1)