peterverebics/CodeNet_Python_118 huggingface dataset:
import math

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

ans = 0
for i in range(n):
    cnt = 0
    for j in reversed(range(n)):
        if i != j:
            if a[i] % a[j] != 0:
                cnt += 1
                if cnt == n-1:
                    ans += 1
            else:
                break
print(ans)
N=int(input())
A=list(map(int,input().split()))


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

f=[True]*(max(A)+1)
chk=[0]*(max(A)+1)

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

for a in A:
    cnt=2
    while a*cnt<=max(A):
        f[a*cnt]=False
        cnt+=1
ans=0
for a in A:
    if f[a]==True and chk[a]==1:
        ans+=1
print(ans)
n=int(input())
a=list(map(int,input().split()))
from collections import Counter
seta=set(a)
ca=dict(Counter(a))
a=[k for k,v in ca.items() if v==1]
if len(a)==0:
  print(0)
  exit()
a.sort()
maxa=a[-1]
for ai in a:
  i=2
  while maxa>=i*ai:
    seta.discard(i*ai)
    i+=1
print(len(seta))
N = int(input())
A = sorted(map(int, input().split()), reverse=False)
dp = [0] * (max(A)+1)

for i in range(N):
    if dp[A[i]] == 0:
        dp[A[i]] = 1
        for j in range(i+1, N):
            if dp[A[j]] == 0 and A[j] % A[i] == 0:
                dp[A[j]] = 2
print(dp.count(1))
def main():
    n, *a = map(int, open(0).read().split())
    if n == 1:
        print(1)
        return

    m = max(a) + 1
    l = [0] * m
    for i in a:
        for j in range(i, m, i):
            l[j] += 2
        l[i] -= 1

    ans = sum(l[i] == -1 for i in a)
    print(ans)


if __name__ == "__main__":
    main()
import collections
import numpy as np

N = int(input())
A = sorted([int(i) for i in input().split()])
a = collections.Counter(A)
A = np.array([i[0] for i in a.items() if i[1] == 1])

ans = 0
while len(A) > 0:
    if len(A) == 1:
        ans += 1
    elif A[0] != A[1]:
        ans += 1
    n = A[0]
    A = A[np.where(A % n != 0)[0]]
    
print(ans)
n=int(input())
a=list(map(int,input().split()))
a.sort()
ok=[0]*(a[-1]+1)
for i in range(n):
  ok[a[i]]+=1
for i in range(n):
  if ok[a[i]]>1:
    ok[a[i]]=0
  elif ok[a[i]]:
    for j in range(2,a[-1]//a[i]+1):
      ok[a[i]*j]=0
    
print(sum(ok))
N = int(input())
A = list(map(int, input().split()))
A = sorted(list(set(A)), reverse=True)

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

ans = 0
for i in range(N-1):
    flag = True
    for j in range(i+1, N):
        if A[i] % A[j] == 0:
            flag = False
            break
    if flag:
        ans += 1

print(ans+1)
from collections import deque
import copy
m=int(input())
a=list(map(int, input().split()))
a.sort()

li= []
li.append(a[0])
for i in range(1,len(a)):
    if all(a[i]%j != 0 for j in li) or li == []:
        li.append(a[i])
    elif not all(a[i] != j for j in li):
        li.remove(a[i])


print(len(li))
N = int(input())
A = list(map(int, input().split()))
B = set()
cnt = 0
for i in range(N-1):
  for j in range(N-1):
    if A[j] % A[i] == 0 and i != j:
      B.add(A[j])
for i in range(N-1):
  if A[j] == A[i] and i != j:
    cnt += 1
    
print(N-cnt-len(B)-1)
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)):
        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()))
K = {}
A.sort()
before = -1
for i in A:
    c = 2
    if before == i:
        K[i] = 1
    while(True):
        if i*c > 2*(10**5):
            break
        K[i*c] = 1
        c += 1
    before = i
t = 0
for i in A:
    if i in K:
        t += 1
print(N-t)
N = int(input())
A = list(map(int,input().split()))

A = A[::-1]
a = A.copy()

ans_list = list()
A_len =len(A)

while A_len != 0:
    for i in range(A_len-1):
        if A[i+1] % A[0]==0:
            a.remove(A[i+1])
    ans_list.append(A[0])
    a.remove(A[0])
    A = a.copy()
    A_len = len(A)
ans = len(ans_list)
print(ans-1)
import sys

input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
r = 0
if len(set(a)) == 1:
    print(0)
    exit()

for i in a:
    for k in a:
        if i == k :
            continue
        if i % k == 0:
            r += 1
            break

print(n-r)
from itertools import permutations

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

temp = dict(map(lambda x: (x, x[0] % x[1]), permutations(set(nums), 2)))
not_ans = set(map(lambda x: x[0], filter(lambda x: temp[x] == 0, temp)))

ans = list(filter(lambda x: not x in not_ans, nums))

print(len(ans))
from collections import Counter
from math import sqrt
from bisect import bisect_left
n = int(input())
a = Counter(map(int, input().split()))
nums = sorted(list(a.keys()))
ans = n
for num, count in a.items():
    if count > 1:
        ans -= count
        continue
    index = bisect_left(nums, sqrt(num))
    search_range = nums[:index + 1]
    for i in search_range:
        if num % i == 0 and num != i:
            ans -= count
            break
print(ans)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = int(readline())
a = list(map(int,readline().split()))
a.sort()
if a[0] == a[-1]:
  print(0)
  exit()

s = set()
ans = 0
s.add(a[0])
for i in a[1:]:
  p = True
  for j in s:
    if i%j == 0:
      ans += 1
      p = False
      break
  if p:
    s.add(j)

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

count = 0
for i in range(N):
  for j in range(i+1, N):
    if x_list[i]%x_list[j] == 0:
      break
    if j == N-1:
      count += 1
print(count)
n = int(input())
a = set(map(int, input().split()))

iter = 0

for i in a:
  lst = [i%j for j in a]
  if lst.count(0) == 1:
    iter = iter + 1
print(iter)
n = int(input())
a = sorted([int(each) for each in input().split()])
if len(set(a)) == 1:
    print(0)
else:
    counter = 1
    for i in range(1, n):
        for j in range(i):
            if i == j:
                continue
            if a[i]/a[j] == a[i]//a[j]:
                break
        else:
            # print(i, j)
            counter += 1

    print(counter)
N = int(input())
lis = [1] * (10**7+1)
for i in range(2,10**7+1):
    for j in range(i,10**7+1,i):
        lis[j] += 1
ans = 0
for i in range(1,N+1):
    ans += lis[i] * i
print(ans)
from collections import Counter

n = int(input())
A = sorted(map(int, input().split()))
c = Counter(A)
flag = [False] * n
for i in range(n):
    if c[A[i]] > 1:
        flag[i] = True
    if flag[i] == False:
        for j in range(i+1, n):
            if A[j] % A[i] == 0:
                flag[j] = True
print(flag.count(False))
N = int(input())
A = list(map(int, input().split()))
A.sort()
exist_flags = [0] * (10 ** 6)
for a in A:
    if exist_flags[a - 1] > 0:
        exist_flags[a - 1] += 1
    else:
        # for i in range(a, 25, a):
        for i in range(a, 10 ** 6, a):
            exist_flags[i - 1] += 1


ans = 0
for a in A:
    if exist_flags[a - 1] == 1:
        ans += 1
print(ans)
import sys
input = sys.stdin.readline

n = int(input())
a = [int(x) for x in input().split()]
maxval = 10 ** 6
factor_cnt = [0] * (maxval+1)
factor_cnt[0] = 2
factor_cnt[1] = 2
for i in range(n):
    if factor_cnt[a[i]] > 1:
        continue
    for k in range(a[i], maxval+1, a[i]):
        factor_cnt[k] += 1

result = sum(factor_cnt[v] == 1 for v in a)
print(result)
n = int(input())
A = list(map(int, input().split()))
sortedA = sorted(A)

dp = {}
double = {}
A_max = sortedA[-1:][0]
for i in A:
  if dp.get(i):
    double[i] = True
  dp[i] = True
for i in sortedA:
  j = 2
  while i * j < A_max:
    if dp.get(i * j):
      dp[i * j] = False
    j += 1
count = 0
for key, value in dp.items():
  if double.get(key) is None and value:
    count += 1
if len(A) == 1:
  print(0)
else:
  print(count)
n = int(input())
a = list(map(int, input().split()))
a.sort()
flag = False
b = [False] * 1000010
c = [False] * 1000010
for i in range(n - 1):
    if a[i] == a[i + 1]:
        b[a[i]] = True

ans = 0
for i in range(n):
    if b[a[i]]:
        continue
    if not c[a[i]]:
        ans += 1
        for j in range(a[i], 1000010, a[i]):
            c[j] = True

print(ans)
import numpy as np

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

A_sorted=np.sort(A)
result=[]
a=A_sorted[0]
while A_sorted.size>0:
    a=A_sorted[0]
    if A_sorted.size==1:
        result.append(a)
        break
    A_sorted=A_sorted[1:]
    if a in A_sorted:
        A_sorted=A_sorted[A_sorted!=a]
        continue
    result.append(a)
    A_sorted=A_sorted[A_sorted%a!=0]
print(len(result))
n = int(input())
l = list(map(int, input().split()))

l.sort()

i = 0
while i < len(l):
    if i != len(l)-1 and l[i] == l[i+1]:
        k = l[i]
        h = i
        while i < len(l) and l[i] == k:
            l.remove(k)
        i += 1
    else:
        l = l[:i+1] + [j for j in l[i+1:] if j % l[i] != 0]
        i += 1

print(len(l))
n=int(input())
a=list(map(int,input().split()))
cnt=0
for i in range(n):
  for k in range(n-i-1):
    if a[i]%a[i+k+1]==0:
      break
    else:
      if i+k+1!=n-1:
        pass
      else:
        cnt+=1
print(cnt)
n = int(input())
a = list(map(int, input().split()))
a.sort()

new_a = [a[0]]

for i in a[1::]:
    flag = 1
    for j in new_a:
        if i % j == 0:
            flag = 0
            break
    if flag:
        new_a.append(i)

print(len(new_a))
n = int(input())
a = list(map(int,input().split()))
a.sort()
ok = [1]*(10**6+1)
ans = 0
for i in range(n):
    if ok[a[i]]:
        if i < n-1:
            if a[i+1] != a[i]:
                ans += 1
        else:
            ans += 1
        for j in range(1,10**6//a[i]):
            ok[a[i]*j] = 0
print(ans)
import bisect
import math

n = int(input())
a = [int(num) for num in input().split()]
b = [0] * 1000001
for i in range(n):
    b[a[i]] = 1
    
ans = 0

for i in range(n):
    fl = True
    for j in range(1,int(math.sqrt(a[i])) + 2):
        if a[i] % j == 0 and (b[j] > 0 or b[a[i] // j] > 0):
            fl = False
            break
    if fl:
        ans += 1
        
print(ans)
def main():
    n = int(input())
    a = list(map(int, input().rstrip().split(' ')))
    ans = 0
    for i in range(n):
        for j in range(n):
            if i == j:
                continue
            if a[i] == a[j]:
                continue
            if a[i] % a[j] == 0:
                ans += 1
    print(ans)

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

N = int(input())
As = sorted(map(int, input().split()))

Aset = sorted(list(set(As)))
count = Counter(As)

ans = 0
for i in range(len(Aset)-1, 0, -1):
  if count[Aset[i]] > 1:
    continue
  for j in range(0,i):
    if Aset[i] % Aset[j] == 0:
      break
  else:
    ans += 1

if len(As) > 1 and As[0] != As[1]:
  ans += 1
  
print(ans)
N =int(input())
A = list(map(int, input().split()))
 
element1=[]
for u in range(N):
    for i in range(N):
        if A[u]<=A[i]:
            continue
        amari=A[u]%A[i]
        if amari  == 0 :
            
            element1.append(A[u])
a=set(A)^set(element1)
print(len(a))
n = int(input())
li = list(map(int,input().split()))
li.sort()
if len(set(li)) == 1:
    print(0)
    exit()
for i in range(10^5):
    li.append(1122887)
count = 0
for i in range(n):
    if li[i] == 1122887:
        break
    j = i + 1
    while True:
        if li[j] == 1122887:
            break
        if li[j] % li[i] == 0:
            li.remove(li[j])
            count += 1
        else:
            j += 1
print(n - count)
def actual(n, A):
    A = sorted(list(set(A)))

    if len(A) == 1:
        return 0

    judge_list = []
    while len(A) > 0:
        a_i = A.pop()

        s = [(a_i != a_j) and (a_i % a_j == 0) for a_j in A]

        judge_list.append(not any(s))

    return judge_list.count(True)

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

print(actual(n, A))
import sys
N=int(input())
alist=list(map(int,input().split()))
aset=set(alist)
if len(aset)==1:
  print(0)
  sys.exit(0)

alist.sort()
#print(alist)

pset=set()
for i in range(N):
  for p in pset:
    if alist[i]%p==0:
      break
  else:
    pset.add(alist[i])
    
#print(pset)
print(len(pset))
N = int(input())
A = input().split()
A = [int(s) for s in A]
list.sort(A, reverse=True)

count = 0

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

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

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

a.sort(reverse=True)
cnt = n

for i in range(len(a) - 1):
    for j in a[i + 1:]:
        if a[i] % j == 0:
            cnt -= 1
            break
if a[-1] in a[:n - 1]:
    cnt -= 1
print(cnt)
import sys
import math
input=sys.stdin.readline
n=int(input())
a=list(map(int,input().split()))

ans=1
a=sorted(a)

if n==1:
  print(ans)
  
else:
  for x in range(1,n):
    b=a[x]
    c=math.sqrt(b)
    ch=0
    for u in range(x):
      if a[u]>c:
        continue
      if not b%a[u]==0:
        ch+=1
        continue
        
    if ch==0:
      ans+=1
      
print(ans)
import numpy as np
N = int(input())
p = list(map(int,input().split()))

arr = np.array(p)
rev = 1/arr
ans = 0
for i in range(N):
    a = arr[i]*rev
    for j in range(N):
        d = a[j].is_integer()
        if a[j]==1:
            ans = ans
        elif d:
            ans = ans + 1
            break
print(N-ans)
import numpy as np

N = int(input())
Alist = np.asarray( list(map(int, input().split())) )
y = np.zeros((N, ))

for i in range(1, N):
  y += (Alist % np.roll( Alist, i ) ) == 0

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

a.sort()
def Eratosthenes(x):
    cnt = 0
    nmax = x[-1]
    is_prime = [True] * (nmax+1)
    for i in a:
        if not is_prime[i]:
            continue
        for j in range(i*2, nmax+1, i):
            is_prime[j] = False
    for i in range(1, nmax+1):
        if is_prime[i] == True and i in set(x):
            cnt += 1
    print(cnt)

Eratosthenes(a)
N = int(input())
As = list(map(int, input().split()))
 
Fs = [1]*N
 
As.sort()
if N == 1:
  print(1)
  exit()

lst = [As[0]]

for i in range(1,N):
  if As[i] == As[i-1]:
    Fs[i] = 0
    if Fs[i-1] == 1:
      Fs[i-1] = 0
    continue
  for l in lst:
    flag = 1
    if As[i] < 2*l:
      break
    if As[i]%l == 0:
      Fs[i] = 0
      flag = 0
      break
    if flag == 1:
      lst.append(As[i])
        
print(sum(Fs))
n = int(input())
a = list(map(int, input().split()))
mx = max(a)

dp = [0] * (mx+1)
for i in sorted(set(a)):
    if dp[i] == 1:
        continue
    for j in range(2, mx):
        if i * j > mx:
            break
        dp[i*j] = 1

cnt = 0
for i in a:
    if dp[i] == 0 and a.count(i) == 1:
        cnt += 1

print(cnt)
#!/usr/bin/env python

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

t = [True for _ in range(n)]
a = sorted(a)
ma = a[-1]

for i in range(n):
    for j in range(i+1, n): 
        if t[j] == False: continue
        if a[j]%a[i] == 0:
            t[j] = False

ans = sum(t)
if len(set(a)) != n:
    print(ans-1)
else:
    print(ans)
n=int(input())
l=list(map(int,input().split()))
l.sort()
dp=[1]*n
for i in range(n-1):
  if dp[i]==1:
    x=l[i]
    for j in range(i+1,n):
      if l[j]%x==0:
        dp[j]=0
print(sum(dp))
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
ans = 0
con = False
for i in range(1, n):
    if a[i] == a[i-1]:
        con = True
        a[i-1] = 0
    elif con:
        con = False
        ans -= 1
if con:
    ans -= 1

ng = [0] * 1050000
for i in range(n):
    if not a[i]:
        continue
    if not ng[a[i]]:
        ans += 1
        for j in range(2, 1050000//a[i]):
            ng[a[i]*j] = 1
print(ans)
N = int(input())
A = list(map(int, input().split()))
A.sort()
results = []
while(A):
  a = A.pop(0)
  oldnA = len(A)
  A = [i for i in A if i%a!=0]
  results.append(oldnA-len(A))
print(N-sum(results))
N=int(input())
A=list(map(int,input().split()))


A.sort(reverse=True)
S=0
if len(set(A)) == 1:
    print(int(0))

else:
    for i in set(A):
        for j in set(A):
            if i%j==0 and i!=j:
                S+=1
                break

    print(int(N-S))
from collections import defaultdict

N = int(input())
arr1 = [int(i) for i in input().split()]
arr = []
Dict = defaultdict(int)
for i in range(N):
    Dict[arr1[i]] += 1
for i in range(N):
    if Dict[arr1[i]] == 1:
        arr.append(arr1[i])
n = int(10 ** 6)
prime = [True for i in range(n + 10)]
for p in arr:
    if prime[p]:
        start = p+p
        for j in range(start, n + 1, p):
            prime[j] = False
count = 0
for i in arr:
    if prime[i]:
        count += 1
print(count)
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)

    divisors.sort()
    return divisors
n = int(input())
numlist = sorted(list(map(int,input().split())))

counter = 0
print(numlist)
for i in range(n):
    temp = set(numlist[i+1:])
    divs = set(make_divisors(numlist[i]))
    if len(temp-divs) == len(temp):
        counter += 1
print(counter)
n=int(input())
a=list(int(i) for i in input().split())
a.sort()
a2=[]
kotae=[]

for i in range(n):
  if 2<=len(a):
    if a[1]!=a[0]:
      kotae.append(a[0])
  else:
    kotae.append(a[0])
  kotae.append(a[0])
  for j in range(1,len(a)):
    if a[j]%a[0]!=0:
      a2.append(a[j])
  a=a2
  a2=[]
  if len(a)==0:
    break
       
print(len(kotae))
N = int(input())
A = list(map(int,input().split()))

cnt =0
for i in A:
    j_list = []
    for t in A:
        if i == t:
            continue
        else:
            j = i % t
            j_list.append(j)
    if 0 not in j_list:
        cnt += 1

print(cnt)
N = int(input())
A = list(map(int, input().split()))
A.sort()
B = [0] * (10 ** 6 + 1)
M = max(A)

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

if max(B) == N:
	print(0)
else:
	for a in A:
		if B[a] > 0:
			i = 2
			b = a * i
			while b <= M:
				B[b] = 0
				i += 1
				b = a * i
	for i in range(len(B)):
		if B[i] > 1:
			B[i] = 0
	print(sum(B))
N = int(input())
A = list(map(int,input().split()))
count = 0

for i in A:
    for j in A:
        if i != j:
            if i % j == 0:
                count += 1
                break
print(count)
import numpy as np


def main():
    n = int(input())
    As = list(map(int, input().split()))
    if 1 in As:
        print(0)
        exit()
    As = sorted(As)
    As_arr = np.array(As)
    ans = 0

    minus_num = 0
    while np.any(As_arr):
        if np.sum(As_arr == As_arr[0]) >= 2:
            minus_num += 1
        As_arr = As_arr[np.where(As_arr % As_arr[0] != 0)]
        ans += 1
    ans -= minus_num
    print(ans)


if __name__ == "__main__":
    main()
n = int(input())
a = list(map(int,input().split()))

c = 0
for i in range(n):
    p = True
    for j in range(n):
        if a[i] > a[j]:
            if a[i]%a[j] == 0:
                p = False
                break
    if p:
        c += 1
print(c)
N = int(input())
A = [int(i) for i in input().split()]
A.sort()

ans = 0
for i in range(N):
    if i == 0:
        if N != 1 and A[0] != A[1]:
            ans += 1
    else:
        if any(A[i] % A[i - j] == 0 for j in range(1, i + 1)):
            pass
        else:
            ans += 1
print(ans)
N = int(input())
if N == 1:
  print(0)
  exit()
List = list(map(int,input().split()))
List.sort()
counter = 0
while len(List) > 0:
  flag = 0
  if len(List)> 1 and List[0] == List[1]:
    flag = 1
  List = [item for item in List if item%List[0]!=0]
  if flag == 0:
    counter += 1
print(counter)
import math
from collections import Counter

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

A = Counter(A)
A = sorted(A.items(), key=lambda x: x[0])
# print(A)

ans = 0
divs = []
for i, n in A:
    flg = False
    if n > 1:
        continue
    for j in divs:
        if i % j == 0:
            flg = True
    if flg:
        pass
    else:
        divs.append(i)
        ans += 1

print(ans)
N = int(input())
Al = [int(i) for i in input().split()]

ans = 0
divjl = []
#sAl = sorted(Al)
for i in range(len(Al)):
    if i in divjl:
        continue
    flag = True
    for j in range(len(Al)):
        if i == j:
            continue
        if Al[i] % Al[j] == 0:
            flag = False
            divjl.append(j)
    if flag:
        ans += 1

print(ans)
n = int(input())
a = [int(i) for i in input().split()]
a = sorted(a, reverse=True)
count = 0
for i in range(len(a)):
    flag = 0
    for j in range(i+1,len(a)):
        if a[i] % a[len(a)-j+i] == 0:
            flag += 1
            break
    if i == len(a)-1:
        if a[i] % a[i-1] == 0:
            flag +=1
    if flag ==0:
        count += 1
print(count)
N = int(input())
*A,=map(int,input().split())
A = sorted(A)

flag=[1]*(N+1)
flag[0] = 0
for i in range(N-1):
  if flag[i]==0:continue
  for j in range(i+1,N):
    if flag[j]==0:continue
    if A[j]%A[i] == 0:
      flag[j] = 0
      
print(sum(flag))
import sys
input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))
A.sort() # 一応

count = 0
while A:
    new = []
    b = A[0]
    for a in A[1:]:
        if a % b > 0: # bで割れなければ続投
            new.append(a)
    A = new
    count += 1


print(count)
n=int(input())
a=list(map(int,input().split()))
b=sorted(a,reverse=True)
ans=0
for i in range(n-1):
    flag=0
    for j in range(i+1,n):
        if b[i]%b[j]==0:
            flag=1
            break
    if flag==0:
        ans += 1

if b[0]>b[n-1]:
    print(ans+1)
else:
    print(ans)
n = int(input())
arr = [int(x) for x in input().split()]

if n == 1:
    print(0)
else:
    max_arr = max(arr)
    mark = [0 for i in range(max_arr+1)]

    for i in range(n):
        for j in range(arr[i], max_arr+1, arr[i]):
            mark[j] += 1
    # print(mark)
    count = 0
    for i in range(n):
        if mark[arr[i]] == 1:
            count += 1
    print(count)
n = int(input())
a = list(map(int,input().split()))
a.sort(reverse=True)
sum = 0
for i in range(n):
    f = True
    if a[i] % a[i-1] == 0:
        continue
    for j in range(i+1,n):
        if a[i] % a[j] == 0:
            f = False
            break
    if f:
        sum += 1
print(sum)
n = int(input())
a = sorted(set(map(int, input().split())))

al = a[-1]
table = [True] * (al+1)
cnt = 0
if len(a) == 1:
    print(0)
    exit()
for i in a:
    if table[i]:
        cnt += 1
    for j in range(al):
        if i * j > al:
            break
        else:
            table[i * j] = False
print(cnt)
from decimal import Decimal
from collections import Counter

N = int(input())
A = [int(_) for _ in input().split()]
max_a = max(A)
min_a = min(A)
counter_A = Counter(A)
set_A = set([k for k, c in counter_A.items() if c == 1])

for a in A:
  if a not in set_A:
    continue
  i = 2
  while True:
    num = a * i
    if num > max_a:
      break
    if num in set_A:
      set_A.remove(num)
    i += 1

print(len(set_A))
N = int(input())
l = list(map(int, input().split()))

l.sort(reverse=True)
cnt = 0
for i in range(len(l)-1):
    for j in range(i+1, len(l)):
        if l[i] % l[j] == 0:
            break
        if j == len(l)-1:
            cnt += 1
if l.count(l[-1]) == 1:
    print(cnt+1)
else:
    print(cnt)
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
A = lr()
A.sort()
bl = [True] * (A[-1]+1)
answer = 0
for i, a in enumerate(A):
    if i < N-1 and A[i+1] == a:
        bl[a] = False
    elif bl[a]:
        answer += 1
        bl[a] = False
    next = a + a
    while next <= A[-1] and bl[next]:
        bl[next] = False
        next += a

print(answer)
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=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)