peterverebics/CodeNet_Python_118 huggingface dataset:
M=10**6+1
_,*l=map(int,open(0).read().split())
a=[0]*M
for i in l:
  a[i]+=1
  if a[i]==1:
    for j in range(2*i,M,i): a[j]=2
print(a.count(1))
N = int(input())
A_list = list(map(int, input().split()))
M = 10**6+1
cnt = [0 for _ in range(M)]

for i in A_list:
    if cnt[i] != 0:
        cnt[i] = 2
        continue
    for j in range(i, M, i): cnt[j] += 1

ans = 0
for k in A_list:
    if cnt[k] == 1: ans += 1
print(ans)
n = int(input())
a = list(map(int,input().split()))

cnt = [0]*(10**6+1)

for elem in a:
    cnt[elem] += 1

unique = []
for i in range(10**6+1):
    if cnt[i] == 1:
        unique.append(i)

cnt = [0]*(10**6+1)
a = list(set(a))

for elem in a:
    for m in range(elem*2,10**6+1,elem):
        cnt[m] = 1

ans = 0
for elem in unique:
    if cnt[elem] == 0:
        ans += 1

print(ans)
import sys
input = lambda: sys.stdin.buffer.readline()

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

m = 10**6+10
d = [False] * (m+1)
ans = 0
for i in range(n):
    same = (i > 0 and a[i] == a[i-1]) or (i < (n-1) and a[i] == a[i+1])
    x = a[i]
    if not d[x] and not same: ans += 1
    
    if (i > 0 and a[i] == a[i-1]): continue
    for j in range(x, m+1, x):
        d[j] = True
    
print(ans)
from collections import Counter
import sys
n=int(input())
a=sorted(list(map(int,input().split())))
 
c=[1 for i in range(10**6+1)]
d = Counter(a)
s = list(set(a))
count = 0
if d[1] == 1:
  print(1)
  sys.exit()
elif d[1] >=2:
  print(0)
  sys.exit()
for x in s:
  t = x * 2
  while t <= 10 ** 6:
    c[t] = 0
    t += x
 
for x in a:
  if d[x] == 1 and c[x] == 1:
    count += 1
print(count)
from collections import Counter
 
 
def main():
    N = int(input())
    A = list(map(int, input().split(' ')))
    counter = Counter(A)
    searched = [0 for _ in range(10 ** 6 + 1)]
    ans = 0
    for i in range(1, 10 ** 6 + 1):
        if counter[i] == 0:
            continue
        if searched[i] == 0 and counter[i] == 1:
            ans += 1
        for j in range(1, ((10 ** 6) // i) + 1):
            searched[i * j] = 1
    print(ans)
 
 
if __name__ == '__main__':
    main()
import numpy as np
from collections import Counter

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

dp = [0]*(a[-1]+1)
dp = np.array(dp,int)

for i in a:
    dp[i] = 1

for i in a:
    if dp[i] == 1:
        dp[2*i::i] = 0

c = Counter(a)

for i,j in c.items():
    if j > 1:
        dp[i] = 0

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

M = 10**6 + 1

cnt = [0] * M

for a in A:
    if cnt[a] != 0:
        cnt[a] += 1
        continue
    for b in range(a, M, a):
        cnt[b] += 1

ans = 0
for a in A:
    if cnt[a] == 1:ans += 1

print(ans)
n = int(input())
a = list(map(int, input().split()))
M = max(a)
ok = [0]*(M+1)
a.sort()

for i in range(n):
    ok[a[i]] += 1
    if ok[a[i]] == 1:
        for g in range(a[i], M+1, a[i]):
            if g != a[i]:
                ok[g] += 2


print(ok.count(1))
from collections import defaultdict

N = int(input())
a = list(map(int, input().split()))
anstable = [0] * (10 ** 6 + 1)
d = defaultdict(int)
for i in a:
    d[i] += 1

u = []
for i, v in d.items():
    if v == 1:
        u.append(i)
a = set(a)
for i in a:
    for j in range(i * 2, 10 ** 6 + 1, i):
        anstable[j] += 1

cnt = 0
for i in u:
    if anstable[i] == 0:
        cnt += 1

print(cnt)
import numpy as np
n = int(input())
a = np.sort(np.array(list(map(int, input().split()))))
max_num = a[-1]+1
dp = np.array([0]*(max_num))

if np.count_nonzero(a==1)  == 1:
    print(1)
else:
    for i in a:
        for j in np.arange(i, max_num, i):
            dp[j] += 1
    print(np.count_nonzero(dp[a] == 1))
n = int(input())
a = list(map(int, input().split()))

a.sort()
a_max = a[-1]
ban = [0]*(a_max+1)

count = 0
for i in range(n):
    if ban[a[i]]:
        continue
    else:
        if i == n-1 or a[i+1] != a[i]:
            count += 1
        x = a[i]
        while x <= a_max:
            ban[x] = 1
            x += a[i]
#print(ban)
print(count)
N = int(input())
A = list(map(int, input().split()))
S = set(A)
M = max(S)
A.sort()

pre_a = 0
for a in A:
    if a == pre_a:
        S.discard(a)
    if a in S:
        j = a * 2
        while j <= M:
            S.discard(j)
            j += a
    pre_a = a
print(len(S))
N = 1000001
a = [0]* N
input()
for x in input().split():
  a[int(x)] += 1
for i in range(1, N):
  if a[i]:
    for j in range(i + i, N, i):
      a[j] = 0
print(a.count(1))
n = int(input())
a = [int(i) for i in input().split()]
a.sort()

ma = 2 * 10 ** 6
tab = [False] * (ma)

mapp = {}
for i in a:
    if i in mapp:
        mapp[i] += 1
    else:
        mapp[i] = 1

ans = 0
for i in a:
    if not tab[i]:
        if mapp[i] == 1:
            ans += 1
        for j in range(i, ma, i):
            tab[j] = True
print(ans)
import sys
import heapq
from collections import Counter
from math import sqrt

n = int(input())
a_s = [int(i) for i in sys.stdin.readline().split()]
a_s.sort()
_max = max(a_s)
ct = Counter(a_s)
cnt = 0
ls = [False] * (10**6+1)
for a in a_s:
    if ls[a]:
        cnt += 1
        continue
    elif ct[a] > 1:
        cnt += 1
    for i in range(a, _max+1, a):
        if ls[i]:
            continue
        if i % a == 0:
            ls[i] = True

print(n - cnt)
n = int(input())
A = sorted(list(map(int, input().split())))
from collections import Counter
c = Counter(A)

dp = [1]*(max(A)+1)
#print(dp)
for i in c.keys():
    j = i*2
    while j<len(dp):
        dp[j] = 0
        j += i
        #print(j, end=',')
ans = 0
for i in c.keys():
    if c[i] == 1:
        if dp[i] == 1:
            ans += 1
print(ans)
# -*- coding: utf-8 -*-
import sys

N,*A = map(int, sys.stdin.buffer.read().split())

S = [0 for _ in range(10**6+1)]
T = [0 for _ in range(10**6+1)]

for a in A:
  S[a] += 1

count = 0
for i in range(1,10**6+1):
  if T[i] == 1:
    continue
  if S[i] == 0:
    continue
  if S[i] == 1:
    count += 1
  for j in range(10**6//i+1):
    T[i*j] = 1

print(count)
from collections import defaultdict

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

bool_list = [True] * (10 ** 6 + 1)

duplicate_dic = defaultdict(int)
for a in A:
    duplicate_dic[a] += 1
    if duplicate_dic[a] > 1:
        bool_list[a] = False

for a in A_sort:
    for i in range(2*a, 10 ** 6 + 1, a):
        bool_list[i] = False

print(sum([1 for a in A_sort if bool_list[a]]))
def main():
  n=int(input())
  a=list(map(int,input().split()))
  a.sort()
  a_max=a[-1]
  x=[True]*(a_max+1)
  a=a+[0]
  for i in range(n):
    ai=a[i]
    if x[ai]:
      l=a_max//ai-1
      aj=ai
      for _ in range(l):
        aj+=ai
        x[aj]=False
    if a[i]==a[i+1]:
      x[a[i]]=False
  ans=0
  x[0]=False
  for i in a:
    if x[i]:
      ans+=1
  print(ans)
if __name__=='__main__':
  main()
import sys
from collections import Counter
N = int(sys.stdin.readline().rstrip())
A = list(map(int, sys.stdin.readline().rstrip().split()))
A_counters = Counter(A)
A.sort()
A_set = set(A)
ans = 0
for a in A:
    if a in A_set:
        if A_counters[a] == 1:
            ans += 1
        for i in range(1, A[-1] // a + 1):
            if a * i in A_set:
                A_set.remove(a * i)
print(ans)
N = int(input())
A = list(map(int, input().split()))
M = max(A)+1
cnt = [0]*M
ans = 0
for a in A:
    if cnt[a] != 0:
        cnt[a] = 2
    else:
        for i in range(a, M, a):
            cnt[i] += 1
for a in A:
    if cnt[a] == 1:
        ans += 1
print(ans)
n = int(input())
a = list(map(int,input().split()))

a.sort()
li = [True] * (10**6 + 10)
ans = 0

for i in range(n):
    if not li[a[i]]:
        continue
    li[a[i]] = False
    tmp = a[i]
    while tmp < len(li):
        li[tmp] = False
        tmp += a[i]
    if i < n-1:
        if a[i+1] == a[i]:
            continue
    ans += 1


print(ans)
N=int(input())
A=list(map(int,input().split()))
D=set()
S=set()
for i in range(N):
    if A[i] in S:
        D.add(A[i])
    else:
        S.add(A[i])
M=max(S)
X=[1 for i in range(M+1)]
for a in S:
    if a in D:
        X[a]=0
    for i in range(2*a,M+1,a):
        X[i]=0
ans=0
for i in range(N):
    if X[A[i]]==1:
        ans+=1
print(ans)
def main():
  N=input()
  A=sorted(map(int,input().split()))
  M=A[-1]+1
  B=[True]*M
  c=0
  x=0
  for i in A:
    if B[i]:
      if i!=c:
        for j in range(i*2,M,i):
          B[j]=False
        x+=1
        c=i
      else:
        B[i]=False
        x-=1
  print(x)
main()
from collections import Counter

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

A.sort()

ans = 0
tmp = [True for i in range(A[-1] + 1)]

for i in range(N - 1):
    if tmp[A[i]]:
        if A[i + 1] != A[i]:
            ans += 1
        for j in range(A[i], A[-1] + 1, A[i]):
            tmp[j] = False
if tmp[A[-1]]:
    ans += 1
print(ans)
n = int(input())
al = list(map(int, input().split()))

cnt = [0]*(10**6+10)
for a in al:
    if cnt[a]>1:
        continue
    for i in range(0,10**6+10,a):
        cnt[i] += 1

res = 0
for a in al:
    if cnt[a]==1:
        res += 1
print(res)
N=int(input())
ls=list(map(int,input().split()))
ls.sort()

#定数倍のやつに＋１する
M=max(ls)
A=[0]*(M+1)
for i in range(N):
  a=M//ls[i]
  for j in range(1,a+1):
    A[j*ls[i]]+=1
    
ans=0     
for i in range(len(ls)):
  if A[ls[i]]==1:
    ans+=1
print(ans)
from collections import Counter

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

prime = [0 for i in range(ma)]

for a in A:
    for j in range(a, ma+1, a):
        prime[j-1] += 1

cnt = 0
for i in A:
    if(prime[i-1] == 1):
        cnt += 1
       
print(cnt)
N = int(input())
A = list(map(int,input().split()))
A.sort()
MAX = A[-1]+1
num_tmp = [0]*MAX

for a in A:
    num_tmp[a] += 1
    if num_tmp[a] == 1:
        for i in range(2*a,MAX,a):
            num_tmp[i] = 2

print(num_tmp.count(1))
import sys

n = input()
x = list(map(int, input().split()))
#x = [i for i in range(2, 10**5)]

MAXA = 10**6

used = [False for i in range(MAXA + 5)]
result = 0
counts = {}
for a in x:
	if a in counts:
		counts[a] += 1
	else: 
		counts[a] = 1

for x in range(MAXA + 1):
	if not used[x]:
		if x in counts:
			count = counts[x]		
			if count == 1:
				result += 1

			y = 2*x
			while y <= MAXA:
				used[y] = True
				y += x

print(result)
from collections import Counter
n = int(input())
a = list(map(int,input().split()))
a.sort()
ct = Counter(a)
st = set()
ans = 0
x = max(a)
for i in range(n):
    if a[i] in st:
        continue
    if ct[a[i]]>1:
        st.add(a[i])
    for j in range(2,x//a[i]+1):
        st.add(a[i]*j)
for i in range(n):
    if not a[i] in st:
        ans += 1
print(ans)
n = int(input())
A = sorted(list(map(int, input().split())))
M = 10**6 + 1
L = [0]*M
for a in A:
    L[a] += 1
    if L[a] == 1:
        # k>=2として k*aは全て不適
        for i in range(2*a, M, a):
            L[i] += 2
# flagの数が答え
print(L.count(1))
from collections import Counter
def resolve():
    N = int(input())
    A = list(map(int,input().split()))

    B= set(A)

    A.sort()
    dpt = [True]*(A[-1]+1)
    for i in A:
        if dpt[i]==False:
            continue
        for j in range(i*2,A[-1]+1,i):
            dpt[j] = False
    co = Counter(A)
    c=0
    for i,v in dict(co).items():
        if dpt[i] and v==1:
            c+=1
    print(c)
resolve()
n = int(input())
a = list(map(int, input().split()))
cnt = [0] * ((10**6)+1)

for elem in a:
    cnt[elem] += 1

unique = []

for i in range((10**6)+1):
    if cnt[i] == 1:
        unique.append(i)

cnt = [0] * ((10**6)+1)

a = list(set(a))

for elem in a:
    for m in range(elem*2, (10**6)+1, elem):
        cnt[m] = 1

ans = 0

for elem in unique:
    if cnt[elem] == 0:
        ans+=1

print(ans)
def func(n, a):
    mx = max(a)
    x = [0] * (mx + 1) # len(x)
    for i in a:
        x[i] += 1
    for i in range(1, mx + 1):
        if x[i] != 0:
            for j in range(2 * i, mx + 1, i):
                x[j] = 0
        if x[i] > 1:
            x[i] = 0
    print(sum(x)) # 31401

n = int(input())
a = list(map(int, input().split()))
func(n, a)
n=int(input())
a=list(map(int,input().split()))
m=max(a)
a.sort()
dp=[True]*(m+1)
h=dict()
for i in a:
    if i not in h:
        h[i]=1
    else:
        h[i]+=1
    j=2
    while j*i<=m:
        dp[i*j]=False
        j+=1
ans=0
for i in a:
    if dp[i]==True and h[i]==1:
        ans+=1
print(ans)
N = int(input())
A = list(map(int, input().split()))

A.sort()
A_max = A[-1]

checked = [False] * (A_max+1)
ans = 0
for i in range(N):
    if i < N-1:
        if A[i] == A[i+1]:
            for j in range(A[i], A_max+1, A[i]):
                checked[j] = True
    if checked[A[i]]:
        pass
    else:
        ans += 1
        for j in range(A[i], A_max+1, A[i]):
            checked[j] = True

print(ans)
from collections import Counter
N = int(input())
*A, = map(int, input().split())
A.sort()
c = Counter(A)
ans = 0
d = [0]*(10**6+1)
for i in range(N):
    if d[A[i]] == 0:
        if c[A[i]] == 1:
            ans += 1
        j = A[i]
        while j <= (10**6):
            d[j] += 1
            j += A[i]
print(ans)
N = int(input())
a = list(map(int, input().split()))

cnt = {}

for item in a:
    if item not in cnt:
        cnt[item] = 0
    cnt[item] += 1

A = list(set(a))

candidate = []

for item in A:
    if cnt[item] == 1:
        candidate.append(item)

judge = [True] *(10**6 + 1)

for item in A:
    for i in range(2, ((10**6)//item) + 1):
        judge[item*i] = False

ans = 0

for item in candidate:
    if judge[item]:
        ans += 1

print(ans)
N = int(input())
A = list(map(int, input().split()))
ma = max(A)

X = [0] * (ma + 1)
ans = 0
A.sort()

for a in A:
    X[a] += 1
for a in A:
    if X[a] ==1:
        ans += 1
    num = 1
    while num * a <= ma:
        X[num * a] += 2
        num += 1

print(ans)
N = int(input())
A = sorted(list(map(int,input().split())))
B = (10**6+1)*[0]

for a in A:
  B[a]+=1
  if B[a]==1:
    for n in range(2*a,10**6+1,a):
      B[n]+=2

print(B.count(1))
N = int(input())
A = list(map(int, input().split()))

l = [0] *(10**6+1)

for i in range(N):
    num = A[i]
    if l[num] != 0:
        l[num] = 2
        continue
    for j in range(num, 10**6+1, num):
        l[j] += 1
ans = 0
for i in range(N):
    num = A[i]
    if l[num] == 1:
        ans += 1
print(ans)
import numpy as np
n = int(input())
li_a = list(map(int, input().split()))
m = max(li_a)
e = np.zeros(m)
dup = []
for a in li_a:
    if(e[a-1]==1):
        dup.append(a-1)
        continue
    e[a-1] = 1

for i in dup:
    e[i] = 0

for a in set(li_a):
    origin = a
    while a <= m:
        if a==origin:
            a += origin
            continue
        e[a-1]=0
        a += origin
print(int(sum(e)))
N = int(input())
A = list(map(int, input().split()))
max_a = max(A) + 1
counter = [0 for _ in range(max_a)]

for i in A:
    for j in range(i, max_a, i):
        counter[j] += 1

res = 0

for a in A:
    if counter[a] == 1:
        res += 1

print(res)
import collections

n=int(input())
arr=list(map(int,input().split()))
arr=sorted(arr)
s=set()
cnt=collections.Counter(arr)

for i in range(n):
 if arr[i] in s:
   continue
 if cnt[arr[i]]>=2:
   s.add(arr[i])
 for j in range(2,10**6//arr[i]+1):
   s.add(arr[i]*j)
ans=0
for i in range(n):
 if arr[i] in s:
   continue
 ans+=1

print(ans)
n=int(input())
A=list(map(int,input().split()))
A.sort()
t=0
e=[True]*1000001
for i in range(n-1):
    a=A[i]
    if e[a]==False:
        continue
    b=a*2
    while b < 1000001:
        e[b]=False
        b+=a
    if A[i+1]==a:
        e[a]=False
for a in A:
    if e[a]:
        t+=1
print(t)
from collections import Counter
import numpy as np

n = int(input())
a = list(map(int, input().split()))
MAX = 10 ** 6

c = Counter(a)
arr = np.zeros(MAX + 1, np.int64)
st = set()
for k, v in c.items():
    if v != 1:
        st.add(k)
    arr[k] = 1

for i in range(MAX + 1):
    if arr[i]:
        arr[i*2::i] = 0

    if i in st:
        arr[i] = 0

print(arr.sum())
N = int(input())
A = list(map(int,input().split()))
A = sorted(A)

d = {}
for a in A:
  d.setdefault(a,0)
  d[a] += 1
  
A = sorted(set(A))
t = [True] * (10 ** 6 + 1)
for a in A:
    if d[a] > 1:
        t[a] = False
    for i in range(a + a, 10 ** 6 + 1, a):
        t[i] = False
print(sum(1 for a in A if t[a]))
n=int(input())
a=list(map(int,input().split()))

cnt=[0]*((10**6)+1)

for elem in a:
    cnt[elem]+=1

unique=[]

for i in range((10**6)+1):
    if cnt[i]==1:
        unique.append(i)

cnt=[0]*((10**6)+1)

a=list(set(a))

for elem in a:
    for i in range(elem*2,(10**6)+1,elem):
        cnt[i]+=1

ans=0
for elem in unique:
    if cnt[elem]==0:
        ans+=1

print(ans)
from collections import Counter
N = int(input())
A = sorted(map(int, input().split()), reverse=False)
m = max(A)+1
c = Counter(A)
s = list(set(A))
dp = [True] * m
for x in list(set(A)):
    t = x * 2
    while t < m:
        dp[t] = False
        t += x
ans = 0
for a in A:
    if c[a] == 1 and dp[a]:
        ans += 1
print(ans)
N = int(input())
A = list(map(int, input().split()))
M = 10**6 + 5
cnt = [0 for _ in range(M)]

for i in A:
    if cnt[i] != 0:
        cnt[i] = 2
        continue
    
    j = i
    while j < M:
        cnt[j] += 1
        j += i
ans = 0
for i in A:
    if cnt[i] == 1:
        ans += 1
print(ans)
n=int(input())
a=list(map(int,input().split()))
a.sort()
amax=max(a)
dp=[True]*(amax+1)
ans=0
for i in range(n):
    if dp[a[i]]:
        ans+=1
        for j in range(a[i],amax+1,a[i]):
            dp[j]=False
        if i<n-1:
            if a[i]==a[i+1]:
                ans-=1
print(ans)
N = int(input())
A = list(map(int,input().split()))
U = [0]*(10**6+1)
for e in A:
    U[e] += 1
ans = 0
for k in range(1,10**6+1):
    if U[k] == 1:
        ans += 1
    if U[k] > 0:
        for l in range(2*k,10**6+1,k):
            if U[l] > 0:
                U[l] += 1
print(ans)
import collections

def main():
    n = int(input())
    A = sorted(map(int, input().split()))

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

    m = max(A)
    S = set()

    ans = 0
    for i in range(n):
        a = A[i]

        if a in S:
            continue

        if D[a] == 1:
            ans += 1

        num = a
        while num <= m:
            S.add(num)
            num += a

    print(ans)


main()
import sys
input = sys.stdin.readline

n = int(input())

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

c = [0] * (10**6+1)
for i in a:
    c[i] += 1

uni = []
a = list(set(a))

for i in a:
    if c[i] == 1:
        uni.append(i)

b = [0 for _ in range(10**6+1)]

for i in a:
    for j in range(i*2, 10**6+1, i):
        b[j] = 1

cnt = 0
for i in uni:
    if b[i] == 0:
        cnt += 1

print(cnt)
N = int(input())
ans = 0
A = list(map(int,input().rstrip().split(" ")))
A.sort()
A2 = [True for i in range(A[-1] + 1)]
for i in range(len(A)):
    k = A[i] * 2
    if A2[A[i]]:
        if i != 0 and A[i-1] == A[i]:
            A2[A[i]] = False
        while(k < len(A2)):
            A2[k] = False
            k += A[i]
for i in A:
    if A2[i]:
        ans += 1
print(ans)
N = int(input())
A = list(map(int, input().split()))

A.sort()
C = [0] * A[-1]
for Ai in A:
    if C[Ai - 1] >= 1:
        C[Ai - 1] += 1
        continue
    i = Ai
    while i <= A[-1]:
        C[i - 1] += 1
        i += Ai
print(sum([C[Ai - 1] == 1 for Ai in A]))
N = int(input())
A = list(map(int, input().split()))
l = max(A)+1
li = [0]*(l)
A.sort()

for a in A:
  if li[a] == 0:
    li[a] = 1
    for i in range(a*2, l, a):
      li[i] = 2
  elif li[a] == 1:
    li[a] = 2
print(li.count(1))
from collections import defaultdict

n = int(input())
a = list(map(int, input().split()))
a.sort()
d = defaultdict(int)
for ai in a:
    d[ai] += 1

m = a[-1]
x = [True for _ in range(m + 1)]

ans = 0
c = defaultdict(bool)
for ai in a:
    if x[ai] and d[ai] == 1:
        ans += 1
    if not c[ai]:
        c[ai] = True
        for j in range(2 * ai, m + 1, ai):
            x[j] = False
print(ans)
N = int(input())
nums = list(map(int, input().split()))
nums.sort()
checked = [0 for _ in range(nums[-1]+1)]
answer = 0
for i in range(N-1):
  if checked[nums[i]] == 1:
    continue
  else:
    if nums[i] != nums[i+1]:
      answer += 1
    count = 1
    temp = nums[i]
    while(temp <= nums[-1]):
      checked[temp] = 1
      count += 1
      temp= nums[i]*count
if checked[nums[-1]] == 0:
  answer += 1
print(answer)
def main():
  n=int(input())
  a=sorted(map(int,input().split()))
  maxa=a[-1]+1
  tf=[False]*maxa
  r=0
  n-=1
  for i in range(n):
    a_i=a[i]
    if tf[a_i] ==False:
      for j in range(a_i,maxa,a_i):
        tf[j]=True
      if a_i  <a[i+1]:
        #print(a_i)
        r+=1
  if tf[-1] ==False:
    r+=1
  print(r)
main()
n = int(input())
l = list(map(int,input().split()))

l.sort()
j = [0]*(10**6+1)

for i in l:
    j[i] += 1
    if j[i] == 1:
        for k in range(2*i,10**6+1,i):
            j[k] += 100

print(j.count(1))
def II(): return int(input())
def LI(): return list(map(int, input().split()))

N=II()
A=LI()
cnt=[0]*((10**6)+1)
for a in A:
  cnt[a]+=1
  
unique=[]
for i in range((10**6)+1):
  if cnt[i]==1:
    unique.append(i)
    
ans=0
cnt=[0]*((10**6)+1)
A=list(set(A))
for elem in A:
  for i in range(elem*2,(10**6)+1,elem):
    cnt[i]=1
for i in unique:
  if cnt[i]==0:
    ans+=1
print(ans)
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)
prime = [True] * (10 ** 6 + 10)

b = sorted(set(a))

for i in b:
    num = i * 2
    while True:
        if num >= 10 ** 6 + 1:
            break
        prime[num] = False
        num += i

ans = 0
for s in a:
    if prime[s] == True and c[s] == 1:
        ans += 1

print(ans)
N = int(input())
A = list(map(int, input().split()))
A.sort()
B = [0] * (10**6+1)
ans = 0
for a in A:
    if B[a] == 0:
        ans += 1
        B[a] = 2
        tmp = 2*a
        while tmp <= 10**6:
            B[tmp] = 1
            tmp += a
    elif B[a] == 2:
        B[a] = 1
        ans -= 1
print(ans)
M = 10 ** 6 + 1
N = int(input())
A = list(map(int, input().split()))
 
A.sort()
not_divisible = [True] * (M)
# print(A)

result = 0
for i in range(N):
    target = A[i]
    if not_divisible[target]:
        if i+1 <= N-1 and A[i+1] == A[i]:
            pass
        else:
            result += 1
        for j in range(target, M, target):
            not_divisible[j] = False
print(result)
N = int(input())
A = list(map(int, input().split()))

A.sort()

maxnum = A[-1]
checklist = [True]*(maxnum+1)
before = 0

for a in A:
    if before == a:
        checklist[a] = False
        continue
    num = 2
    while num * a <= maxnum:
        checklist[a * num] = False
        num += 1
    before = a

ans = 0
for i in A:
    ans += checklist[i]
print(ans)
import sys
input = sys.stdin.readline

'''

'''

n = int(input())
a = sorted(map(int, input().split()))
largest = a[-1]
#largest = arr[-1]
div = [1] * (largest+1)
count = 0
arr = []
# remove duplicates
for i, v in enumerate(a):
    if i < (n-1) and a[i+1] == v:
        div[v] = 0
    else:
        arr.append(v)

for num in arr:
    if div[num]:
        count += 1

    for d in range(num, largest+1, num):
        div[d] = 0

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

a_max = max(a)
cnt = [0] * (max(a) + 1)
ans = 0

for ai in a:
    for multi in range(ai, a_max + 1, ai):
        cnt[multi] += 1

for ai in a:
    if cnt[ai] == 1:
        ans += 1

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

a_sorted = sorted(a)
divisible_list = [0] * (max(a)+1)

for i in range(len(a)):
    # 過去にすでに同じ数字への加算があったら飛ばす
    if divisible_list[a[i]] > 2:
        continue
    for j in range(0, len(divisible_list), a[i]):
        divisible_list[j] += 1

ans = 0
for i in range(len(a)):
    if divisible_list[a[i]] == 1:
        ans+=1
print(ans)
a = [0]* 1000001
m = 0
input()
for x in map(int, input().split()):
  m = max(m, x)
  a[x] += 1
m += 1
for i in range(1, m):
  if a[i]:
    for j in range(i + i, m, i):
      a[j] = 0
print(a[:m].count(1))
n,a=int(input()),sorted(list(map(int,input().split())))
m=a[-1]+1
s=[0]*m
for i in a:s[i]+=1
for i in set(a):
	if s[i]:
		for j in range(i*2,m,i):s[j]=0
print(s.count(1))