peterverebics/CodeNet_Python_118 huggingface dataset:
N = int(input())
A = [int(x) for x in input().split()]

A = list(set(A))

A.sort()

#print(A)

flag = 0

for i in range(1, len(A)):
  list=[]
  for p in range(1, len(A)):
    if A[p] % A[0] == 0:
      list.append(A[p])
  for p in range(len(list)):
    A.remove(list[p])
  flag += 1
  del A[0]
  if len(A) == 1:
    flag += 1
    break
  if len(A) == 0:
    break
  #print(A)
    
print(flag)
N = int(input())
alist = list(map(int, input().split()))

alist.sort()

count = 0

for i in range(0, N):
  
  a = alist[i]
  flag = 0
  
  if i != N - 1:
    if alist[i + 1] == a:
      continue
      
  if i != 0:
    if alist[i - 1] == a:
      continue

  for j in range(i):
    b = alist[j]
    if b * b <= a:
      if a % b == 0:
        flag = 1
        break
        
  if flag == 0:
    count += 1
      
print(count)
import os

n = int(input())
an = [int(i) for i in input().split()]
an.sort()
ans = [an[0]]

if len(list(set(an)))==1:
    print(0)
    exit()

for i in range(1,n):
    flag = True
    for j in ans:
        if an[i]%j==0:
            flag = False
            break
    if flag:
        ans.append(an[i])

answer = len(ans)

print(answer)
# -*- coding: utf-8 -*-
from collections import Counter
n = int(input())
a = [int(i) for i in input().split()] 

c = Counter(a)
a.sort()
max_a = a[-1]
flag = [True for _ in range(max_a+1)]
ans = []
for i in a:
    if c[i] >= 2:
        flag[i] = False
    elif not flag[i]:
        continue
    else:
        for j in range(i + i, max_a + 1, i):
            flag[j] = False
for i in a:
    if flag[i]:
        ans.append(i)
#print(ans)
print(len(ans))
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    n, *a = map(int, read().split())

    a.sort()
    notdiv = [True] * n
    for i1, ae in enumerate(a):
        if notdiv[i1]:
            for i2, ae2 in enumerate(a[i1+1:]):
                if notdiv[i1 + i2 + 1]:
                    notdiv[i1 + i2 + 1] = ae2 % ae != 0

    r = sum(notdiv) - (n - len(set(a)))
    r = max(r, 0)
    print(r)
if __name__ == '__main__':
    main()
n=int(input())
a=list(map(int,input().split()))
r=0
f=set()
for i in a:
  ff=0
  for j in range(1,int(pow(i,0.5))+1):
    if(i%j==0):
      if(j in f or i//j  in f):
        ff=1
  if(ff==0):
    r+=1
  f.add(i)
print(r)
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
count = 0

for i in range(n-1):
    for j in range(1,n-i):
        if a[i]%a[i+j] == 0:
            count += 1
            break

print(n-count)
N = int(input())

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


b = sorted(list(A))
dp = [0]*(max(A)+4)

for i in b:
    dp[i] += 1
    if dp[i]==1 :
        for j in range(2, max(A)//i+1):
            dp[j*i] =-1

print(dp.count(1))
n = int(input())
a_str_list = input().split()
a_int_list = [int(x) for x in a_str_list]

cnt = 0

for a in a_int_list:
    flg = 0
    for a_tmp in a_int_list:
        if((a != a_tmp) and (a % a_tmp == 0)):
            flg = 1
            break
    if(flg == 0):
        cnt += 1
    
print(cnt)
import sys
input = sys.stdin.readline

n = int(input())
li = list(map(int,input().split()))
li2 = li[:]
li2.sort(reverse=True)
ans = 0

if len(set(li)) == 1:
    ans = 0
else:
    for i,num in enumerate(li2,1):
        temp = 0
        j_list = li2[i:]
        for j in j_list:
            if num % j == 0:
                break
            else:
                temp += 1
        if temp == n - i:
            ans += 1
print(ans)
# -*- coding: utf-8 -*-
import numpy as np
def solution():
    
    n = int(input())
    inputList = list(map(int, input().split()))
    numpyArray = np.array(inputList)
    resultCount = 0
    for i in range(n):
        newArray = numpyArray[numpyArray != inputList[i]]
        test = lambda x: inputList[i] % x
        newArray = test(newArray)
        if newArray.size>0 and 0 not in newArray:
            resultCount += 1

    print(resultCount)

solution()
N = int(input())
nums = list(map(int, input().split()))
count = [0]*N
nums.sort()
for i in range(N):
  fNum = nums[i]
  for j in range(0,N):
    if (nums[j] > fNum):
      break
    if (count[i] == 1):
      continue
    else:
      sNum = nums[j]
      if (fNum%sNum == 0):
      	count[i] += 1
answer = 0
print(count)
for i in count:
  if (i == 0):
    answer += 1
print(answer)
N= int(input())
A = list(map(int, input().split()))
#A.sort()
B = A.copy()

for i in range(N):
    B = [b for b in B if b % A[i] != 0 or b == A[i]]
    print(B)

print(len(B))
n = int(input())
a_i = list(map(int,input().split()))

def solve():
    ans = 0
    count = 0
    for i in range(1, 1000001):
        if i in a_i:
            for j in range(n):
                if i != a_i[j] and i % a_i[j] == 0:
                    break
            else:
                ans += 1
        count += 1
        if count == n:
            break
    return ans

print(solve())
# -*- coding: utf-8 -*-
import sys

N = int(input().strip())
A_list = list(map(int, input().rstrip().split()))
#-----

A_list = list(set(A_list))

if len(A_list) == 1:
    print(0)
    sys.exit()

A_list.sort()
check = [1]*len(A_list)

for i in range(len(A_list)-1):
    for j in range(i+1, len(A_list)):
        
        if A_list[j] % A_list[i] == 0:
            check[j] = 0

print(check.count(1))
n = int(input())
A = list(map(int, input().split()))

A.sort()

x = A[0]
flag = True
for a in A:
    if a % x != 0:
        flag = False
if flag:
    print(0)
    exit()

used = [False] * A[-1]
ans = 0
for idx, a in enumerate(A):
    if used[a - 1]:
        continue
    ans += 1
    for j in range(2 * a, len(used) + 1, a):
        used[j - 1] = True
print(ans)
n = int(input())
arr = list(map(int, input().split()))
arr = sorted(arr)
m = arr[-1]
tf = [True] * (m+1)
cnt = 0
        
for i in range(n):
  ai = arr[i]
  if tf[ai] == True:
    cnt += 1
    for j in range(ai, m, ai):
      tf[j] = False
    if ai in arr[i+1:]:
      cnt -= 1
    

print(cnt)
number = int(input())
# values = [i+2 for i in range(2*10**5)]
values = list(map(int, input().split()))

maxV = 10**6+1
dp = [0]*(maxV)

for a in values:
    if a == 1:
        print(1)
        exit()
    i = 1
    if dp[a] > 1:
        continue
    while i * a < maxV:
        i_a = i * a
        dp[i_a] = dp[i_a] + 1
        i += 1

count = 0
for a in values:
    if dp[a] == 1:
        count+=1

print(count)
N = int(input())
A = [int(i) for i in input().split()]

#A.sort(reverse=True)
A.sort()
cnt = 0
P = [1]*N

for i in range(N):
	for j in range(i+1,N):
		if P[j] != 0:
			 if A[j] % A[i] == 0:
			 	P[j] = 0

if A[0] in A[1:]:
	P[0] = 0

print(P.count(1))
n = int(input())
p = list(map(int,input().split()))
p = [ x for x in set(p) if p.count(x) == 1]
p.sort()
tp = [ 1 for _ in range(len(p))]
for i in range(len(p)):
    if tp[i]:
        for j in range(i+1,len(p)):
            if p[j] % p[i] == 0 and p[j]:
                tp[j] = 0
print(sum(tp))
n = int(input())
*a, = sorted(map(int, input().split()))
a_max = a[n-1]
dp = [True] * a_max
ans = 0
recent = 0

if n == 1:
    print(0)
    exit()

for i in a:
    if recent == i:
        ans -= 1
        recent = 0
    if dp[i-1] == False:
        continue
    else:
        for j in range(i, a_max+1, i):
            dp[j-1] = False
        ans += 1
        recent = i

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

l = sorted(a)
dp = [True] * (max(l) + 1)
ans = 0

if l[0] == max(l):
    print(0)
    exit()

for i in range(n):
    if dp[l[i]] == True:
        ans = ans + 1
        for j in range(n):
            tmp = l[j]
            if tmp % l[i] == 0:
                dp[tmp] = False

#print(dp)
print(ans)
n = int(input())
A = [int(x) for x in input().split()]
A.sort()
ans = 0

cnd = []
for i, a in enumerate(A):
    if i != n - 1 and A[i + 1] == a or i != 0 and A[i - 1] == a:
        continue
    do_count = True
    for c in cnd:
        if a % c == 0:
            do_count = False
            break
    if do_count:
        cnd.append(a)
        ans += 1
print(ans)
N = int(input())
A = list(map(int, input().split()))
A.sort()
b = [True] * 1000001

for i, a in enumerate(A):
  if not b[i]:
    continue
  for i in range(2, 1000001):
    t = a * i
    if t > 1000000:
      break
    b[t] = False

count = 0
for a in A:
  if b[a]:
    count += 1

print(count)
import numpy as np

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

sosu = []
count = 0
for i in range(len(A)):
  if (i != len(A)-1 and A[i] == A[i+1]) or (i != 0 and A[i] == A[i-1]):
    continue
  for s in sosu:
    if A[i] % s == 0:
      break
  else:
    count+=1
    sosu.append(A[i])
print(count)
n = int(input())
a = list(map(int, input().split()))
s = list(set(a))

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

for x in s:
    t = x
    while t <= 10**6:
        P[t] += 1
        t += x

ans = 0

for x in a:
    #print(P[x])
    if P[x] == 1:
        ans += 1

print(ans)
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
cnt = 0

if len(list(set(a))) != 1:
    cnt += 1
    while len(a) != 1:
        judge = True
        for j in a[1: len(a)]:
            if a[0]%j == 0:
                judge = False
                break

        if judge:
            cnt += 1

        del a[0]

print(cnt)
N=int(input())
A=list(map(int,input().split()))
x=0

for i in range(N):
  AS=set(A)
  M=len(AS)
  for j in range(M):
    B=AS.pop()
    if A[i]==B:
      break
    elif A[i]%B==0:
      break
    j+=1
  else:
    x+=1

print(x)
n = int(input())
A = list(map(int, input().split()))
A.sort()

ans = 0
for i in range(n):
    if i == 0 and n > 1:
        if A[i] % A[i+1] != 0:
            ans += 1
    for j in range(i):
        if A[i] % A[j] == 0:
            break
        if j == i - 1:
            ans += 1

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

t = [True] * (10 ** 6 + 1)
d = {}
for a in A:
    d.setdefault(a, 0)
    d[a] += 1
    if d[a] > 1:
        t[a] = False

for a in sorted(set(A)):
    for i in range(a + a, 10 ** 6 + 1, a):
        t[i] = False
print(t.count(True))
N = int(input())
A = list(map(int, input().split()))
cnt = 0
 
A.sort(reverse=True)
for i in range(N):
  ans = True
  for j in range(i+1, N):
    if A[i] % A[j] == 0:
      cnt-=1
      break
  cnt += 1
      
print(cnt)
n=int(input())
l=list(map(int,input().split()))

d={}
for i in range(n):
  if l[i] not in d:
    d[l[i]]=1
  else:
    d[l[i]]+=1
l=set(l)
l=list(l)
l.sort()
n=len(l)
ct=0
if n>1 and d[l[0]]==1:
  #print("*")
  ct=1
elif n==1 and d[l[0]]==1:
  ct=1
for i in range(1,n):
  flag=0
  for j in range(i):
    if l[i]%l[j]==0:
      flag=1
      break
  #print(flag,l[i])
  if flag==0:
    ct+=d[l[i]]

print(ct)
n=int(input())
a=[int(i) for i in input().split()]
ok=False
ans=0
val=a[-1]
for i in range(1,n):
    if a[n-i-1]==a[n-i]:
        ok=True
    if val%a[n-i-1]!=0:
        if a[n-i-1]!=a[n-i]:
            ans+=1
        else:
            ok=True
    val*=a[n-i-1]
if ok:
    print(ans)
else:
    print(n-ans)
n = int(input())
c = set(map(int,input().split()))
a = list(c)
a.sort()
b = []
flag = 0
for i in range(len(a)):
    for j in range(len(b)):
        if a[i]%b[j] == 0:
            flag = 1
            break
    if flag == 0:
        b.append(a[i])
    flag = 0
ans = len(b)
if ans == 1:
    print(0)
else:
    print(ans)
n = int(input())
a = [int(e) for e in input().split()]
 
a.sort()

s = set()
x = a[0]

count = 0
for i in range(n):
    flg = True
    if i == 0 and n > 1 and a[0] == a[1]:
        flg = False
    if a[i] in s:
        flg = False

    if flg:
        count += 1
    if flg or i == 0:
        x = a[i]
        while x < 10 ** 6:
            s.add(x)
            x += a[i]
print(count)
from collections import Counter
n = int(input())
a = sorted(list(map(int,input().split())))
t = list(Counter(a).values())
s = [i for i in t if i>=2]
#print(len(s))
l  = [0 for i in range(10**6+1)]
cou = 0
for i in range(n):
  b = a[i]
  if l[b]==0:
    cou += 1
    for j in range(b,10**6+1,b):
      l[j] = 1
print(cou-len(s))
N=int(input())
A=list(map(int,input().split()))

ans_list=[i for i in range(N)]
for i in range(N):
  for j in range(i+1,N):
    if i in ans_list:
      if A[i]/A[j]-int(A[i]/A[j])==0:
        ans_list.remove(i)
    if j in ans_list:
      if A[j]/A[i]-int(A[j]/A[i])==0:
        ans_list.remove(j)  
        break
      
print(len(ans_list))
#print(gcd_list)
from collections import deque
n = int(input())
A = list(map(int,input().split()))
A.sort()
L = [1]*n
for i in range(n-1):
  if L[i] == 1:
    for j in range(i+1,n):
      if A[j] == A[i]:
        L[i] == 0
      if A[j] % A[i] == 0:
        L[j] = 0
print(sum(L))
n = int(input())
a = list(map(int,input().split()))
r = [0 for _ in range(max(a)+1)]
l = [1 for _ in range(max(a)+1)]
ans = 0
for i in a:
    r[i] += 1
for i in range(len(r)):
    if r[i]:
        for j in range(2*i,len(r),i):
            if 1 < r[j]:
                break
            elif (r[j] == 1 and l[j]):
                ans += 1
                l[j] = 0
print(ans)
n = int(input())
search = list(map(int,input().split()))
search.sort()
double = set([])
for i in range(n-1):
    if search[i+1] == search[i]:
        double.add(search[i])
dp = [1]*(search[-1]+1)
for i in search:
    k = 2*i
    while k <= search[-1]:
        if dp[k]:
            dp[k] = 0
            k += i
        else:
            break
ans = 0
for i in search:
    if i in double:
        continue
    ans += dp[i]
print(ans)
l = int(input())
n = [int(i) for i in input().split()]
u = n.copy()

n.sort()
u.sort(reverse=True)

counter = 0

for i in range(l):
  if n.count(n[i]) >= 2:
      counter += 1
      pass
  else:
    for j in range(l):
      if u[i] == n[j]:
        pass
      elif u[i] % n[j] == 0:
        counter += 1
        break
      else:
        pass

print(l - counter)
from collections import Counter
N = int(input())
A = sorted(list(map(int, input().split())))
dp = [True for i in range(max(A) + 1)]
dp[0] = False
c = Counter(A)
s = set(A)
ans = 0
for i in s:
    if i == 1:
        print(1)
        exit()
    for j in range(2, (max(A) // i) + 1):
        if not dp[i * j]:
            continue
        else:
            dp[i * j] = False

for i in s:
    if c[i] == 1 and dp[i]:
        ans += 1
print(ans)
# import sys
# input = sys.stdin.readline

def mp(): return map(int, input().split())
def lmp(): return list(map(int, input().split()))


n = int(input())
a = lmp()
a.sort()
cnt = 0
amax = max(a)
num = [0]*int(amax+5)
for i in range(n):
    if num[a[i]] == 0:
        cnt += 1
    for j in range(a[i], int(amax+5), a[i]):
        num[j] = 1

for i in range(1,n):
    if a[0] == a[i]:
        cnt -= 1
        break
print(cnt)
N = int(input())
a_list = [int(i) for i in input().split()]
count = 0
for i in a_list:
    flag_i = True
    for j in a_list:
        if  i is j:
            pass
        elif  i % j == 0:
            flag_i = False
    
    if flag_i:
        count += 1
    
print(count)
#Q4
input()
nums = [int(s) for s in input().split(" ")]
nums.sort(reverse=True)
count = 0
for i in range(len(nums) - 1):
    flag = 0
    for j in range(1, len(nums) - i):
        #print("{0} % {1} = {2}".format(nums[i], nums[i + j], nums[i]%nums[i + j]))
        if nums[i]%nums[i + j] == 0:
            flag = 1
    if flag == 0:
        count = count + 1
print(count + 1)
N = int(input())
A = list(map(int, input().split()))
ans = [True] * len(A)


A.sort()

for i in range(len(A)):
        if A[i] > 450:
                break
        for j in range(len(A)):
                if i == j:
                        continue
                if A[j] % A[i] == 0:
                        ans[j] = False


count = 0
for i in ans:
        if i:
                count += 1
print(count)
N = int(input())
As = list(map(int, input().split()))

cnt = 0
l = [False]*(max(As)+1)
for A in As:
  l[A] = True
for i in range(max(As)+1):
  if l[i]:
    cnt += 1
    for j in range(i, max(As)+1, i):
      l[i] = False
print(cnt)
N = int(input())
A = list(map(int, input().split()))

A = list(set(A))
A = sorted(A, reverse=True)
num = 0
N = len(A)
for i in range(N):
    flag = True
    for j in range(i+1, N):
        if A[i] % A[j] == 0:
            flag = False
            break
    if flag == True:
        num += 1
if N == 1:
    print(0)
else:
    print(num)
from collections import deque

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

A.sort()
d = deque()
for i in range(N-1):
    if A[i] != A[i+1]:
        d.append(A[i])
if A[N-1] != A[N-2]:
    d.append(A[N-1])

ans = 0
max_A = max(A)
ban = [0]*(max_A+1)
while len(d):
    num = d.popleft()
    if ban[num] != 1:
        ans += 1
        ban_num = num
        while ban_num <= max_A:
            ban[ban_num] = 1
            ban_num += num

print(ans)
n = int(input())
a = list(map(int,input().split()))
a = sorted(a)
i = 0
b = []
for i in range(len(a)):
    for j in range(i+1,len(a)):
        if a[j]%a[i]==0:
            b.append(j)
#print(a)
#print(b)
b = list(set(b))
if len(list(set(a)))==1:
    print(0)
else:
    print(len(a)-len(b))
N=int(input())
A = [int(x) for x in input().split()]
A.sort()
n=0

for i in range(N):
  for j in range(N-i-1):
    if A[N-i-1]%A[j]==0:
      print(A[N-i-1],A[j])
      n=n+1
print(N-n)

"""
10
33 18 45 28 8 19 89 86 2 4
5
"""
N = int(input())
A = list(sorted(list(map(int, input().split(' ')))))

count = 1

if A[0] in A[1:]:
    count -= 1

for i in range(1, N):
    flag = True
    for j in range(0, i):
        if A[i] % A[j] == 0:
            flag = False
            break
        if A[j] * 2 > A[i]:
            break
    if flag:
        count += 1


print(count)
N = int(input())
AList = list(map(int, input().split()))
if AList.count(AList[0]) == N:
  print(0)
  exit()
ansList = []
while AList:
  minNum = min(AList)
  ansList.append(minNum)
  AList = list(filter(lambda X: X % minNum != 0, AList))
print(len(ansList))
n=int(input())
a= list(map(int, input().split()))    
t=set([x for x in set(a) if a.count(x)>1])
print(0)
N = int(input())
A = list(map(int, input().split()))
total = 0
for i in range(0,N):
  for j in range(0,N):
    if i == j or A[i] == A[j]:
      continue
    if A[i] % A[j] == 0:
      total += 1
print(total)
N = int(input())

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

result = 0
mini = min(A)

for i in range(N):
    if A[i]%mini==0 and A[i]!=mini:
        result +=1
    else:
        for j in range(N):
            if A[i] == A[j]:
                break
            elif A[i]%A[j]==0:
                result +=1
                break

print(result)
import numpy as np

N = int(input())
A = np.array(list(map(int, input().split())))
rsl = 0
for i in range(N):
    dd = A[i]
    B = A%dd
    num = np.count_nonzero(B)
    if num==N-1:
        rsl=rsl+1

print(rsl)
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
A = set(A)
B = [True] * (10 ** 6 + 1)
C = Counter(A)
for a in A:
    for i in range(2 * a,10**6 + 1 ,a):
        B[i] = False
cnt = 0
for a in A:
    if (B[a] == True) and (C[a] == 1):
        cnt += 1
print(cnt)
N = int(input())
A = [int(x) for x in input().split()]

K = 10**6+1
num = [0] * K
for i in range(N):
    num[A[i]]+=1

l = [True] * K

for i in range(2, K):
    if num[i]>0:
        if num[i]>1:
            l[i] = False
        j = 2
        while i*j < K:
            l[i*j] = False
            j += 1

ans = 0
for i in range(N):
    if l[A[i]]:
        ans += 1

print(ans)
import numpy as np
import sys
input = sys.stdin.readline


def main():
    n = int(input())
    A = [int(i) for i in input().split()]

    max_dp = np.max(A) + 1
    dp = np.zeros(max_dp, dtype="int32")

    for a in A:
        if dp[a] >= 2:
            continue
        dp[np.arange(a, max_dp, a)] += 2
        dp[a] -= 1

    print(np.sum(dp == 1))
import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

num = 10 ** 6 + 1 #適当に値を入れる
L = [0 for i in range(num)]
ans = 0
N = int(input())
A = getlist()
for i in range(N):
	L[A[i]] += 1

for i in range(10 ** 6 + 1):
	if L[i] >= 2:
		L[i] = 0

for i in range(num):
	if L[i] == 1:
		ans += 1 ; c = 2
		while i * c <= num - 1:
			L[i * c] = 0; c += 1

print(ans)
n=int(input())
a=list(map(int,input().split()))
d=dict()
for i in a:
    if i in d:
        d[i]+=1
    else:
        d[i]=1
e=list()
for i,j in d.items():
    if j==1:
        e.append(i)
e.sort()
n=len(e)
c=[1 for i in range(n)]
for i in range(n):
    if c[i]==0:
        continue
    for j in range(i):
        if e[i]%e[j]==0:
            c[i]=0
print(len([i for i in c if i]))
#print(e,c,sep='\n')
N=int(input())
A=list(map(int,input().split()))
A.sort()
ans=N
for i in range(N-1):
  if A[i]==A[i+1]:
    ans-=1
  else:  
    for k in range(0,i):
      if A[i]%A[k]==0:
        ans-=1
        break
      if A[k]>(A[i])**(1/2)+2:
        break
for i in range(N-1):
  if A[N-1]%A[i]==0:
    ans-=1
    break
print(ans)
import copy
import sys
input = sys.stdin.readline

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

cnt = 0
new_a = copy.copy(a)
for i in a:
    new_a.remove(i)
    tmp = True
    if new_a == []:
        tmp = False
    for j in new_a:
        if i%j == 0:
            tmp = False
            break
    if tmp:
        new_a.append(i)
        cnt += 1

print(cnt)
import sys
input = sys.stdin.readline

N = int(input())
A = sorted([int(i) for i in input().split()])

dp = [-1] * (A[-1]+1)
ans = 0
for i in range(N):
    a = A[i]
    if dp[a] != -1:
        continue

    if A.count(a) == 1:
        ans += 1
        for j in range(a+a, A[-1]+1, a):
            dp[j] = 0
    else:
        dp[a] = 0

print(ans)
n = int(input())
a = list(map(int, input().split()))
num = [0]*(10**6+1)
for x in a:
    if num[x] != 0:
        num[x] = 2
        continue
    for i in range(x, 10**6//x+1, x):
        num[i] += 1
ans = 0
for x in a:
    if num[x] == 1:
        ans += 1

print(ans)
N = int(input())
alist = list(map(int, input().split()))
asetlist = list(set(alist))
asetlist.sort()

count = 0

for i in asetlist:
  if alist.count(i) >= 2:
    count += 1

i = 0

while i < len(asetlist):
  a = asetlist[i]
  j = i + 1

  while j < len(asetlist):
    if asetlist[j] % a == 0:
      del asetlist[j]
    else:
      j += 1

  i += 1

print(len(asetlist) - count)
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse = True)
print('A={0}'.format(A))
cnt = 0
for i in range(N):
  flg = True
  for j in range(i,N):
    if i != j and A[i]%A[j] == 0 :
      flg = False
      break
  if flg:
    cnt+=1
print(cnt)
N = int(input())
A = sorted(list(map(int, input().split())))
#print(A)
s = 0
t = -1

for i in range(N):
    f = 0
    for j in range(i):
        if A[i] % A[j] == 0:
            f = 1
            break
    if f == 0:
        s += 1
        #print(i)
    if A[0] != A[i]:
        t = 0
        
print(s+t)
n = int(input())
a_list = list(map(int, input().split()))
a_list.sort()
ans = 0

if len(a_list) == 1:
    print(0)
else:
    if a_list[0] != a_list[1]:
        ans += 1
    for i in range(1, n):
        for j in range(i):
            if a_list[j] > a_list[i] / 2:
                break
            if a_list[i] % a_list[j] == 0:
                break;
            if j == i - 1:
                ans += 1

print(ans)
import numpy as np
N = int(input())
A = list(map(int,input().split()))

chofuku_dict = {}
chofuku = []

for a in A:
    if a not in chofuku_dict:
        chofuku_dict[a] = 1
    else:
        chofuku.append(a)
        
chofuku = set(chofuku)

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

bl = np.array([0] + [1]*A[-1])

ans = 0
for a in A:
    if bl[a] == 0:
        continue
    if a in chofuku:
        continue
    ans += 1
    bl[2*a::a] = 0
print(ans)
import sys
input = sys.stdin.readline
import math
from collections import defaultdict

n = map(int, input())
a = list(map(int, input().split()))
a2 = list(set(a))
b = [0] * 1000005
for x in a2:
    for j in list(range(2, 1000005)):
        if x * j > 100005:
            break
        else:
            b[x * j] = 1
ans = 0
for x in a:
    if b[x] != 1:
        ans += 1
d = defaultdict(int)
for x in a:
    d[x] += 1
for x in d:
    if d[x] != 1:
        ans -= d[x]
print(ans)