peterverebics/CodeNet_Python_118 huggingface dataset:
N = int(input())
A = list(map(int, input().split()))
newA = sorted(A)
ans = 0
for k in range(1,N):
  for m in range(k):
    if newA[k] % newA[m] == 0 and newA[k] != newA[m]:
      ans += 1
      break
    else:
      continue
print(ans)
n = int(input())
a=list(map(int, input().split()))

a.sort()
d = {}

ans = 0
for i in range(n):
    #print(d)
    if a[i] not in d.keys():
        if a.count(a[i]) == 1:
            ans += 1
        for j in range(1,1000):
            d[a[i]*j] = 0

print(ans)
n = int(input())
ns = list(map(int, input().split()))
ans = 0
from collections import Counter
c = Counter(ns)
dubbles = set([key for key, value in c.items() if value >= 2])
ignore = set()
ns = sorted(ns)
for i in range(n):
    if ns[i] in dubbles | ignore:
        continue
    ans += 1
    for j in range(i + 1, n):
        if ns[j] % ns[i] == 0:
            ignore.add(ns[j])
print(ans)
n = int(input())
a = list(map(int, input().split()))
a.sort()
flag = [True] * (a[-1]*3)
for i, num in enumerate(a):
    if a[(i-1)%n]==num or a[(i+1)%n]==num:
        flag[num] = False
        continue
    for j in range(2, a[-1]//num+2):
        flag[j*num] = False
counter = 0
for i in a:
    if flag[i]:
        counter += 1
print(counter)
import numpy as np
 
n = int(input())
a = list(set(map(int, input().split())))
a.sort()
l = len(a)
dp = [True for _ in range(a[-1])]

for i in range(l):
    for j in range(a[i] * 2, a[-1] + 1, a[i]):
        dp[j - 1] = False
#for i, result in enumerate(dp):
#    print(i, result)
#print("#" * 15)
ans = 0
for x in a:
    #print(x)
    if dp[x - 1] == True:
        ans += 1
print(ans)
import sys
input = sys.stdin.readline

n=int(input())
L=list(map(int,input().split()))
L.sort()
hb = L[-1]
dp = [-1 for i in range(hb+1)] 
print(L)
for i in L:
    if dp[i]!=0:
        if dp[i]==1:
            dp[i]=0
            continue
        dp[i]=1
        for j in range(2*i,hb+1,i):
            dp[j]=0
ans=0
for i in L:
    if dp[i]==1:
        ans+=1
print(ans)
from collections import Counter

N = int(input())
a_list = [int(_) for _ in input().split()]

a_list = list(sorted(a_list))
c = Counter(a_list)
dup_list = [k for k, v in c.items() if v > 1]

b_list = a_list

ans = []

while b_list != []:
    x = b_list[0]
    if x in a_list:
        a_list = list(filter(lambda z: (z%x != 0 or z==x) and x not in dup_list, a_list))
    b_list.pop(0)

print(len(a_list))
from functools import reduce
from math import gcd

def lcm(A, B):
    return A * B // gcd(A, B)

#S=[33,18,45,28,8,19,89,86,2,4]
n=int(input())
S=sorted(list(map(int,input().split())))
# リストを引数にとる
val=reduce(lcm, S)
cnt=0
for i in S:
    if val%i==0:
        cnt+=1
        val//=i
print(cnt)
n = int(input())
a = list(map(int, input().split()))
a.sort()
multi = [x for x in set(a) if a.count(x) > 1]
a = list(set(a))
ans = 0
dec = 0
i = 0
while i < len(a):
    if a[i] in multi:
        dec += 1
    after = list(map(lambda x:x%a[i],a))
    after[i] += 1
    for j in range(after.count(0)):
        k = after.index(0)
        a.pop(k)
    i += 1
ans = len(a) - dec
print(ans)
import numpy as np
_,*a=map(int,open(0).read().split())
a,c=np.unique(a,return_counts=True)
i = 0
a = a[c==1]
while len(a):
    i+=1
    a = a[a%a[0] != 0]
print(i)
N = int(input())
search_list = list(map(int, input().split()))

if len(set(search_list)) == 1:
    print(0)
    exit()

# エラトステネスの篩っぽく処理
ans_list = []
ans = 0

tmp = min(search_list)

while tmp <= max(search_list)/2:
    if search_list.count(tmp) == 1:
        ans_list.append(tmp)
    search_list = [i for i in search_list if i % tmp != 0]
    if len(search_list) == 0:
        break
    else:
        tmp = min(search_list)

ans = len(ans_list) + len(search_list)
print(ans)
n = int(input())
a = list(map(int, input().split()))

a.sort()
sub = [-1] * n
sub[0] = a[0]
index = 1
count = 1
for i in range(1, n):
    flag = True
    for j in sub[:index]:
        if a[i] // 2 < j:
            break
        if a[i] % j == 0:
            flag = False
    if flag:
        sub[index] = a[i]
        index += 1
        count += 1
print(count)
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
count=0
for i in range(n-1):
    t=0
    if a[i]==a[i-1]:
        continue
    for j in reversed(range(i+1,n)):
        if a[i]%a[j]==0:
            break
        if a[i]//2<a[j]:
            t=1
            break
    else:
        count+=1
    if t==1:
        count+=1
if a[n-1]==a[n-2]:
    print(count)
else:
    print(count+1)
N = int(input())
A = sorted(map(int, input().split()), reverse=True)
cnt = 0

if N == 1:
    print(1)
else:
  for i in range(N-1):
    for j in range(i+1, N):
      if A[i] % A[j] == 0:
        cnt-=1
        break
    cnt += 1
  if A[-2] % A[-1] == 0:
    cnt += 1
  print(cnt)
MAXA = 10**6+1
N = int(input())
A = list(map(int,input().split()))
A.append(MAXA)
A.sort()
hurui = [0]*(MAXA+1)
ans = 0
for j in range(N):
    a = A[j]
    if hurui[a] == 0 and A[j+1] != a:
        ans += 1
    for i in range(a,MAXA+1,a):
        if hurui[i] != 0:
            break
        hurui[i] += 1
print(ans)
N = int(input())
A = list(map(int, input().split()))
len = len(A)
new = sorted(A, reverse=True)
cnt = 1
cnt2 = 1
for i in new:
  for j in new:
    if cnt != cnt2 and i%j == 0:
      len =len - 1
      break
    cnt2 += 1
  cnt += 1
print(len)
import numpy as np



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

max=a[-1]
ans=0
if(len(a)!=len(set(a))):ans-=1
primeNum = []
while a:
    primeNum.append(a[0])
    tmp=a[0]
    a=[i for i in a if i % tmp != 0]
primeNum.extend(a)
ans+=len(primeNum)


print(ans)
n = int(input())
a = sorted(list(map(int, input().split())))
arr = []
du = set()
t = 0

for i in range(n):
    if a[i] == t:
        du.add(a[i])
        continue
    for tmp in arr:
        if a[i] % tmp == 0:
            break
    else:
        arr.append(a[i])
    t = a[i]

print(len(arr) - len(du))
n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=0
flg=0
for i in range(n):
  for j in range(i):
    if a[i]%a[j]==0:
      flg=1
      break
  if flg==0:
    ans=ans+1
  flg=0

print(ans)
import sys

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

Amx = max(A)
A.sort()
As = set(A)
if len(As) == 1:
    print(0)
    sys.exit()
# DP
ans = 0
dp = [True] * (Amx + 1)
for a in As:
    if not dp[a]:
        continue
    ans += 1
    ad = Amx // a
    for i in range(2, ad+1):
        dp[i * a] = False

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

s = 0
u = -1
for i in a:
    #print('s='+str(s))
    #print('i='+ str(i))
    t = 0
    for j in a:
        #print('j='+ str(j))
        if j != i and i % j == 0:
            t += 1
    if j != i and t == 0:
        s += 1
print(s)
n = int(input())
a = list(map(int, input().split()))
a.sort()

if a[0] == a[n-1]:
    print(0)
    exit()

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


print(count)
n = int(input())
a = list(set(list(map(int,input().split()))))
can_div = []
for num1 in range(0,len(a)):
  for num2 in range(1,len(a)):
    if num1 == num2:
      break
    if a[num1] % a[num2] == 0:
      can_div.append(a[num1])
print(len(set(a) - set(can_div)))
n = int(input())
a = list(map(int, input().split()))

a.sort()

cnt = [0]*(a[-1]+1)
uq = []

for i in a:
    cnt[i] = 1

for i in range(a[-1]+1):
    if cnt[i] >= 1:
        uq.append(i)

cnt = [0]*(a[-1]+1)
cnt1 = 0

for i in uq:
    for j in range(2, a[-1]+1):
        if i*j <= a[-1]:
            cnt[i*j] = 1

for i in a:
    if cnt[i] == 0:
        cnt1 += 1

print(cnt1)
import numpy as np

def main():
    N = int(input())
    An = list(set(list(map(int, input().split()))))
    le = len(An)
    if le == 1:
        print(0)
    else:
        ok = [False] * le
        a_An = np.array(An)
        for i, a in enumerate(An):
            temp = a_An / a
            temp[i] = 0.1
            ok = ok | (temp % 1 == 0)
        print(np.count_nonzero(ok == 0))


if __name__ == "__main__":
    main()
from collections import Counter
N = int(input())
A = sorted(list(map(int, input().split())))
C = Counter(A)
cnt = 0
for c in C.values():
    if c >= 2:
        cnt -= 1

def eratos(s):
    primes = set([s])
    for i in range(1,N):
        flag = True
        for p in primes:
            if A[i]%p == 0:
                flag = False
        if flag:
            primes.add(A[i])
    return primes

ans = eratos(A[0])
print(len(ans) + cnt)
n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
for num, i in enumerate(a):
    if(num<len(a)-1):
        if(i == a[num+1]):
            a = list(set(a) - set([i])) 
b = set(a)
for i in a:
    for j in range(2, (a[-1]//i+1)):
        b = b - set([i*j])
print(len(b))
N = int(input())
A = list(map(int, input().split()))
A.sort()
ans = 0
for i, a in enumerate(A):
    if i != N-1:
        if a == A[i+1]:
            continue
    flag = True
    for j in range(i):
        if a % A[j] == 0:
            flag = False
        elif a < 2 * A[j]:
            break
    if flag:
        ans += 1
print(ans)
N = int(input())
pi = [int(i) for i in input().split()]

res = []

if 1 not in pi:
    sorted_p = sorted(pi)
    max_p = sorted_p[-1]

    if sorted_p[0] != max_p:
        for p in sorted_p:
            flag = True
            for div in res:
                if p % div == 0 and p != div:
                    flag = False
                    break
            if flag:
                res.append(p)

print(len(res))
x = int(input())
y = list(map(int, input().split()))

ans = 0

for i, j in enumerate(y):
    for k, l in enumerate(y):
        if k != i or j % l == 0:
            break;
    else:
        ans += 1

print(ans)
n=int(input())
A=[int(i) for i in input().split()]

A.sort()

dat={i:False for i in range(20**5+1)}

ans=0
for ele in A:
    if dat[ele]:
        pass
    else:
        ans+=1
        for i in range(ele,20**5+1,ele):
            dat[i]=True

print(ans)
N = int(input())
List = list(map(int, input().split()))
count = 0
for i in range(N):
  x = List.pop(i)
  for j in range(N-1):
    if x == List[j] or x % List[j] == 0:
      break
    else:
      count += 1
      break
      break
  List.insert(i, x)
print(count)
n = int(input())
a = list(map(int, input().split()))
a.sort()
MAX = int(1e6) + 10
sieve = [0] * int(MAX)
for i in a:
    sieve[i] += 1
ans = 0
for idx, val in enumerate(sieve):
    if val == 0:
        continue
    if val > 1:
        sieve[idx] = 0
        continue
    ans += 1
    for i in range(idx * 2, MAX, idx):
        sieve[i] = 0
print(ans)
import numpy as np
n,*a=map(int,open(0).read().split())
a, c = np.unique(sorted(a), return_counts=True)
a = a[c==1]
i = 0
while len(a):
    a = a[a%a[0] != 0]
    i+=1
print(i)
def sieve(INF=10**6+1):
  p=[-1]*INF
  for i in a:
    if p[i]==-1:
      p[i]=1
      for j in range(2*i,INF,i):p[j]=0
    elif p[i]==1:
      p[i]=0
  p[0],p[1]=0,0
  return p
n=int(input())
a=sorted(list(map(int,input().split())))
p=sieve()
ans=0
for i in a:
  ans+=p[i]
print(ans)
n = int(input())
A = list(map(int, input().split()))
sortedA = sorted(A)

count = 0
for Ai in A:
  flag = 0
  double = 0
  for Aj in sortedA:
    if Aj > Ai / 2:
      break
    if Ai == Aj:
      double += 1
      continue
    if (Ai % Aj) == 0:
      flag = 1
      break
  if flag == 0 and double < 2:
    count += 1

print(count)
n = int(input())
a = list(map(int, input().split()))
num = [0]*(10**6 + 1)
for i in range(n):
    for j in range(1, 10**6//a[i]+1):
        num[a[i]*j] += 1

ans = 0
for i in range(n):
    if num[a[i]] < 2:
        ans += 1

print(num[:30])
print(ans)
n = int(input())
a = list(map(int,input().split()))
a.sort()
cnt = [0] * (10**6 + 1)

for i in a:
    cnt[i] += 1
    
unique = []

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

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

for i in unique:
    for j in range(i*2, 10**6 + 1, i):
        cnt[j] = 1
    
ans = 0

for i in unique:
    if cnt[i] == 0:
        ans += 1
        
print(ans)
N = int(input())
A = list(map(int, input().split()))
MAX = max(A)
dp = [True for _ in range(MAX+1)]

for a in set(A):
    for k in range(2*a,MAX+1,a):
        dp[k] = False
B = sorted(A)
for i in range(len(B)-1):
    if B[i] == B[i-1]:
        dp[B[i]] = False

print(sum(dp[a] for a in set(A)))
from sys import stdin,stdout
#x,n=map(int,stdin.readline().split())
n=int(stdin.readline());ans=1
a=sorted(map(int,stdin.readline().split()))
if len(set(a))==1:
    print(0)
    exit(0)
for i in range(n):
    for j in range(i):
        if a[i]%a[j]==0:
            break
        if j==i-1:ans+=1
print(ans)
from sys import stdin
import sys

MAX_A = 1000001;
N = int(stdin.readline().rstrip())
A = sorted([int(x) for x in stdin.readline().rstrip().split()])
A_one = [x for x in set(A) if A.count(x) == 1]
A = list(set(A))
M = [False]*MAX_A
ans = 0
for a in A:
  if M[a] == False:
    if a in A_one:
    	ans+=1
    M[a::a] = [True]*(len(M[a::a]))
    
print(ans)
N = int(input())
AList = list(map(int, input().split()))
if AList.count(AList[0]) == N:
  print(0)
  exit()

Amax = max(AList)
dp = [True] * Amax

sortList = sorted(AList)
idx = 0
for n in sortList:
  if dp[n-1] == False:
    continue
  for j in range(2, Amax//n+1):
    dp[n*j -1] = False
ansCount = 0
for n in set(AList):
  if dp[n-1] == True:
    ansCount += 1

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

A.sort()

i=0
flag=0
while i<len(A):
    t = A[i]
    A1 = A[0:i+1]
    A2 = []
    for n in A[i+1:N]:
        if n % t != 0:
            A2.append(n)
        if n == t:
            flag = 1
    if flag == 1:
        del A1[-1]
    A1.extend(A2)
    A = A1
    i += 1

print(len(A))
N = int(input())
array = [int(x) for x in input().split()]
if sum(array)/N == array[0]:
    print(0)
    exit()
new_array = []
for i in range(N):
    for j in range(N):
        if i != j:
            device = array[i] % array[j]
            if (device == 0) and (array[i] // array[j]>=1):
                new_array.append(True)
                break

print(N-len(new_array))
N = int(input())
A = list(map(int, input().split()))

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

if len(A) == 1:
    print(0)
    exit()

ans = 0

for num, i in enumerate(A):
    for j in A[num+1:]:
        if i == j or i % j == 0:
            break
    else:
        ans += 1

print(ans)
def solve():
    n = int(input())
    a = list(map(int, input().split()))
    a.sort()
    dp = [True for i in range(10**6+10)]
    ans = 0
    for i in a:
        if dp[i]:
            ans += 1
        for j in range(1, 10**6+10):
            if i*j > 10**6:
                break
            dp[i*j] = False
    print(ans)


if __name__ == '__main__':
    solve()
from collections import Counter

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

A = [int(k) for k, v in Counter(A).items() if v == 1]
A = sorted(A)

seed = []

while A:    
    wareta = set()
    warenai = []

    q = A.pop(0)
    for a in A:
        if a % q == 0:
            wareta.add(a)
        else:
            warenai.append(a)

    if q not in wareta:
        seed.append(q) 

    A = warenai[:]

print(len(seed))
n = int(input())
a = list(map(int, input().split()))
cnt = 0

for i in a:
  if len([j for j in a if i%j != 0 and i != j]) == 0:
    cnt += 1
print(cnt)
n = int(input())
a = list(map(int,input().split()))
count = 0
notdiv = [0]*n
for i in range(n):
    x = 0
    for j in range(n):
        if notdiv[j] == 1 or i == j:
            continue
        if a[i]%a[j] == 0:
            break
        if a[j]%a[i] == 0:
            x = 1
        if j == n-1:
            count +=1
            if x == 0:
                notdiv[i] = 1
print(count)
N = int(input())
A = list(map(int, input().split()))
count = 0

for i in range(N):
    for j in range(N):
        if j == i:
            continue
        elif (A[i] % A[j]) == 0:
            continue
        else:
            count += 1
            break

print(count)
N=int(input())
a=list(map(int,input().split()))
dp=["True"]*(max(a)+1)
dp[0]="False"
a.sort()
seen=set()
pre=0
for x in a:
    if x==pre:
        if x in seen:
            seen.remove(x)
        continue
    if dp[x]=="True":
        seen.add(x)
    pre=x
    i=1
    while x*i<=max(a):
        if dp[x*i]=="True":
            dp[x*i]=="False"
        i+=1
print(len(seen))
n = int(input())
a = sorted(list(map(int, input().split(" "))))
for i in range(0, n):
    if len(a) <= i:
        break
    t = a[0]
    a = list(filter(lambda x: x % t != 0, a)) + [t]

if len(a) == 1:
    print(0)
else:
    print(len(a))
# D - Not Divisible
import numpy as np
from collections import Counter

N = int(input())
A = list(int(a) for a in input().split())
c = Counter(A)
dbl = len([i[0] for i in c.items() if i[1] >= 2])

A.sort()
A = np.array(A)
ans = 0
for i in range(N):
    if A[i] == 0:
        continue
    else:
        ans += 1
        B = A % A[i]
        B = B.astype(np.bool)
        A = A * B

print(ans-dbl)
from collections import defaultdict
mp = defaultdict(int)
n = int(input())
a = list(map(int,input().split()))
seen = [False]*n
a.sort()
dub = 0
res = 0
for k in a:
    if mp[k]==1:
        dub+=1
    mp[k] += 1
for i in range(n):
    for j in range(i+1,n):
        if seen[j]:
            continue
        if a[j]%a[i]==0:
            seen[j] = True
            res += 1
#print(res,dub)
print(n-res-dub)
N=int(input())
A=list(map(int,input().split()))
L=sorted(A)
for i in L:
    for j in L[L.index(i)+1:]:
        if j%i==0:
            L.pop(L.index(j))
        else:
            None
print(len(L))
from itertools import combinations
N=int(input())
A=list(map(int,input().split()))
D=dict()
ans=0
for i in A:
    D[i]=0
for i in list(combinations(A,2)):
    if i[0]%i[1]!=0:
        D[i[0]]+=1
        if D[i[0]]==N-1:
            ans+=1
    if i[1]%i[0]!=0:
        D[i[1]]+=1
        if D[i[1]]==N-1:
            ans+=1
print(ans)
N=int(input())
A=list(map(int,input().split()))

M=max(A)
check=[0]*(M+1)
for i in range(N):
    a=A[i]
    if check[a]>0:
        continue
    while a<=M:
        check[a]+=1
        a+=A[i]
ans=0
for i in range(N):
    if check[A[i]]==1:
        ans+=1

print(ans)
from collections import defaultdict
import math
def divisors(n):
	i = 1
	div = []
	while i <= math.sqrt(n):
		if (n % i == 0):
			if (n / i == i) : 
				div+=[i] 
			else:
				div+=[i,n//i]
		i+=1
	return div
	
n = int(input())
arr = list(map(int,input().split()))
d = defaultdict(int)
for i in arr:
	d[i]+=1
ans = 0
for i in arr:
	if d[i]!=1:
		continue
	temp = divisors(i)
	f = 0
	for j in temp:
		if j!=i:
			if d[j]==1:
				f = 1
				break
	if f==0:
		ans+=1
print(ans)
N = int(input())
A = input().split()
A = [int(s) for s in A]
list.sort(A)

count = 0
if N == 1:
    count = 1

else:
    for i in range(1,N):
        for j in range(i):
            if A[i]%A[j] == 0:
                count += 1
                break

            
    if A[0] == A[1]:
        count += 1

print(N-count)
N = int(input())
A = sorted([int(i) for i in input().split()])
tested = [True for i in range(N)]

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

if A[0] != A[1]:
    ans = [A[0]]
else:
    ans = []

for i in range(1, N):
    flg = True
    if A[i] == A[i-1]:
        continue
    for j in ans:
        if j > A[i] // 2:
            break
        if A[i] % j == 0:
            flg = False
    if flg:
        ans.append(A[i])

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

i=0
num=0

while i<n:

    j=0
    jud=1
    while j<n:
        if i!=j:
            if a[i]>a[j]:

                if a[i]%a[j]==0:
                    jud=0
                    break

        j+=1

    if jud==1:
        num+=1

    i+=1

print(num)
#!/usr/bin/python3

n = int(input())
A = [int(s) for s in input().split(" ")]

from itertools import product
lst = []
for x, y in product(A, A):
    lst.append(x%y)

counter = 0
for i in range(n):
    if lst[i*n:i*n+n].count(0) == 1:
        counter=counter+1
print(lst)
N = int(input())
a = list(map(int,input().split()))
A = sorted(a, reverse=True)
count = 0
for i in range(N):
  flag = False
  for j in range(i+1,N):
    if i != j:
      if A[i] % A[j] == 0:
        flag = True
        break
  if flag == False:
    count += 1
print(count)
import sys
def input():
    return sys.stdin.readline().rstrip('\n')

def calc(N, S):
    A.sort()
    return A[0]

N = int(input())
A = [int(s) for s in input().split()]
print(calc(N, A))
from collections import Counter

input()
c = Counter(map(int, input().split()))
r = c[1] == 1
if c[1] == 0:
  for k, v in c.items():
    if v == 1:
      i = 2
      while i * i <= k:
        if k % i == 0 and  (i in c or k // i in c):
          break
        i += 1
      else:
        r += 1
print(r)
from collections import Counter

n=int(input())
l=list(map(int,input().split()))
c=Counter(l)
l=sorted([x for x in c])
sm=0
if len(l)==1: print(0);exit()
for i in range(1,len(l)):
    for j in range(i):
        if l[i]%l[j]==0:
            break
    else:sm+=c[l[i]]
print(sm+1)
n = int(input())
A_ = [int(i) for i in input().split(None,n)[:n]]
A = sorted(A_)

cand = set()
dup = set()

for a in A:
  if a in cand:
    dup.add(a)
  for c in cand:
    if a % c != 0:
      cand.add(a)
cand -= dup
print(len(cand))
N=int(input())
A=list(map(int,input().split()))

A=list(set(A))

L=len(A)

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

mx=max(A)

f=[1]*L

A.sort()

for i in range(L):
    if A[i]*2>mx:break
    for j in range(i+1,L):
        if A[j]%A[i]==0:
            f[j]=0

print(sum(f))
#abc170
n = int(input())
ln = list(map(int, input().split()))
ln = list(set(ln))
#print(ln)
counter = []
for i in range(len(ln)):
    
    for j in range(i +1, len(ln)):
        if ln[j] % ln[i] == 0:
            counter.append(j)
            #print(i,j)
            
print(len(ln) - len(set(counter) ))
n = int(input())
a = list(map(int,input().split()))
a.sort(reverse=True)
counter = 0
for i in range(n):
  start = 0
  for j in range(i+1,n):
    if a[i] % a[j] == 0:
      start = 1
  if start == 0:
    counter+=1
print(counter)
N = int(input())
*A,=map(int,input().split())
A = sorted(A)

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

flag=set(range(N))
for i in range(N-1):
  if i not in flag:continue
  flag2 = list(flag)
  for j in flag2:
    if j<= i: continue
    if j==i+1 and A[j]==A[i]:
      flag.remove(i)
    if A[j]%A[i] == 0:
      flag.remove(j)
      
print(len(flag))
def main():
  n, *A = map(int, open(0).read().split())
  m = max(A)
  lst = [0] *(m + 1)
  prep = 0
  for i in A:
    if i == prep:
      lst[i] += 1
      continue
    lst[2 * i::i] = [1] * len(lst[2 * i::i])
    prep = i
  res = 0
  for i in A:
    if lst[i] == 0:
      res += 1
  print(res)

if __name__ == '__main__':
  main()
N = int(input())
A = list(map(int, input().split()))
result = 0
B = sorted(A, reverse=True)

for a in range(N-1):
    
    for b in range(a+1,N):
        
        if B[a] % B[b] == 0:
            result+=1
            break

A.remove(B[N-1])
if B[N-1] in A:
    result+=1

print(N - result)
N=int(input())
As=list(map(int,input().split()))

l=[]
As.sort()
prev=0
for Ai in As:
    if Ai == prev:
        if len(l)>0 and l[-1]==prev:
            l.pop()
        continue
    for e in l:
        if Ai%e==0:
            break
    else:
        l.append(Ai)
    prev=Ai
    
print(len(l))
N = int(input())
A = list(map(int, input().split()))

sorted_A = sorted(A)
result = 0

# 倍数を管理するテーブル
lendp = sorted_A[-1] + 1
dp = [0] * lendp

if N == 1:
    print(0)
else:
    for a in sorted_A:
        if dp[a] == 0:
            result += 1
            b = a
            while b < lendp:
                dp[b] += 1
                b += a

    print(result)
#D
n = int(input())
a = list(set(map(int,input().split())))
count=0
for i in a:
    num_div=0
    for j in a:
        if i%j==0:
            num_div+=1
    if num_div==1:
        count+=1
print(count)
N = int(input())
A = sorted(list(map(int,input().split(' '))))
ans = 0
L = [1]*(10**6+1)
for i in A:
    if not L[i]:
        continue
    ans += L[i]
    for j in (i,A[-1],i):
        L[j] = 0
print(ans)
a=int(input())
li = list(map(int, input().split()))

li.sort(reverse=True)
ans = []
kotae = 0
for i in range(a):
    for j in range(i+1,a):
            if not li[i] % li[j] == 0:
                ans.append(i)
    if ans.count(i) == a-1:
        kotae += 1
print(kotae)