peterverebics/CodeNet_Python_118 huggingface dataset:
from collections import Counter
n = int(input())
a = list(map(int, input().split()))

a.sort()
c = Counter(a)
#print(c)
already = []
count = 0
for i in a:
    if c[i] != 1:
        continue
    if len(already) == 0:
        count += 1
        already.append(i)
    else:
        for j in already:
            if i % j == 0:
                break
        else:
            count += 1
            already.append(i)

print(count)
import numpy as np

n = int(input())
li = np.zeros(10**6)
a = np.array(list(map(int, input().split())))
a.sort()
for item in a:
  li[item-1] = 1
#print(li[:100])

for item in a[::-1]:
  li[item-1::item] = 0
  li[item-1] = 1

#print(li[:100])

print(int(li.sum()))
n = int(input())
a = list(map(int, input().split()))
mx = max(a)
a.sort()

dp = [0] * (mx+1)
for i in 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)
from collections import Counter



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

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

ans = 0
for i in range(1,10**6+1):
    if counter[i] == 0:
        continue
    if flg[i] == 0 and counter[i] == 1:
        ans = ans + 1
    for j in range(1,(10**6+1)//i):
        flg[i*j] = 1

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

    _max = 10 ** 6 + 1

    flag = [0] * _max
    A.sort()
    for a in A:
        flag[a] += 1
    
    ans = 0
    for a in A:
        if flag[a] == 1:
            ans += 1
        for i in range((_max - 1) // a):
            flag[a*i] += 1
    
    print(ans)

if __name__ == '__main__':
    main()
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[i] % a_list[j] == 0:
                break;
            if j == i - 1:
                ans += 1
                
print(ans)
from collections import defaultdict
n = int(input())
arr = list(map(int,input().split()))
d = defaultdict(int)
for i in arr:
	d[i]+=1
arr.sort()
maxn = 10**6+100
prime = [True for i in range(maxn+1)]
p = arr[0]
ind = 0
while p*p<=maxn:
	if prime[p]==True:
		for i in range(p+p,maxn+1,p):
			prime[i] = False
	if ind+1<n:
		ind+=1
		p = arr[ind]
	else:
		break
cnt = 0
for i in arr:
	if prime[i]==True and d[i]==1:
		cnt+=1
print(cnt)
n = int(input())
a = list(map(int,input().split()))
a.sort()
tmp_a = [0] * n
for i in range(n):
    if tmp_a[i] == 0:
        for j in range(i+1,n):
            if a[j]%a[i] == 0:
                tmp_a[j] = 1
print(n-sum(tmp_a))
n = int(input())
l = sorted(list(map(int,input().split())))

num = max(l)+1
rcd = [0 for _ in range(num)]

l = set(l)
for x in l:
    for y in range(2*x, num, x):
        if x != rcd[y]:
            rcd[y] = 1

ans = 0
for k in l:
    if rcd[k] == 0:
        ans += 1

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

b = list(c for c in a)

ans = 0

for i in a:
    for j in b:
        if i == j: continue
        elif i % j == 0:
            b.remove(i)
            break
    else: ans += 1

if len(set(a)) == 1: ans = 0
print(ans)
n = int(input())
a = list(map(int, input().split()))
li = [1]*(10**6+5)
a.sort()
ans = 1

for i in range(a[0], len(li), a[0]):
  li[i] = [0]

flag = False
for i in range(1, len(a)):
  if a[i-1] == a[i]:
    flag = True
    continue
  else:
    if flag:
      ans -= 1
    flag = False
  if li[a[i]] == 1:
    ans += 1
    for j in range(a[i], len(li), a[i]):
      li[j] = 0
if flag:
  ans -= 1
print(ans)
n = int(input())
alist = list(map(int, input().split()))
count=0

for i in range(n):
    temp_count = 0
    same_count = 0
    for j in range(n):
        if i == j:
            continue
        if alist[i] == alist[j]:
            same_count += 1
            continue

        if alist[i] % alist[j] != 0:
            temp_count += 1
        if temp_count == len(alist) - same_count+1:
            count += 1

print(count)
import collections
N = int(input())
A = list(map(int,input().split()))
c = collections.Counter(A)

w = []
cnt = 0

lc = list(c.keys())
lc.sort()
for i in lc:
  if c[i] != 1:
    continue
  else:
    res = 0
    for j in w:
      if j > i//2 + 1:
        break
      if i%j == 0:
        res = 1
        break
    if res == 0:    
      w.append(i)
      cnt += 1
if N == 1:
  print(0)
else:  
  print(cnt)
import collections

n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
c = collections.Counter(a)
data = sorted(list(set(a)))
prime_bool = [True]*(max(a)+1)
prime_bool[0] = False

for i in range(len(data)):
  p = data[i]
  if prime_bool[p]:
    #print(p)
    for j in range(2*p, max(a)+1, p):
      prime_bool[j] = False

count = 0
for i in range(len(prime_bool)):
  if prime_bool[i]:
    if c[i] == 1:
      count += 1
#print(count)
print(prime_bool)
N = int(input())
a_set=set(map(int, input().split()))

#a_ls=sorted(a_ls_pre)
#binary=[1]*N

ans=0

while a_set!=set([]):
	m=min(a_set)
	a_new=set([])
	for val in a_set:
		if val%m!=0:
			a_new.add(val)
		
	a_set=a_new
	ans+=1

print(ans)


# 2darray [[0] * 4 for i in range(3)]
# import itertools
import numpy as np
N = int(input())
A = np.array(sorted(list(map(int,input().split()))))

if 1 in A:
  print(0)
else:
  for a in A:
    A = np.delete(A,np.where((A!=a) & (A%a==0)))
  print(len(A))
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:
                tp[j] = 0
print(sum(tp))
n=int(input())
A=list(map(int,input().split()))
A.sort()

box={}
import math
ans=0
for i in range(n):
    check=True
    for k in box:
        if A[i]%k==0:
            check=False
            break
    if i!=n-1:
        if A[i]==A[i+1]:
            check=False
    else:
        if A[i]==A[i-1]:
            check=False
    if check:
        box[A[i]]=1
        ans+=1

print(ans)
import copy

N = int(input())
A_n = set(map(int, input().split(' ')))
# print(A_n)
count = 0
for a in A_n:
    temp = copy.deepcopy(A_n)
    temp.remove(a)
    # print(len(temp))
    if 0 not in set(map(lambda x: a%x, temp)) and len(temp) != 0:
        count += 1
print(count)
import math

n = int(input())
aL = sorted(list(set(list(map(int, input().split(" "))))))

n = len(aL)
if n == 1:
    print(0)
    exit()
ans = n
for i in range(n - 1, -1, -1):
    for j in range(i):
        if aL[j] * 2 > aL[i]:
            break
        if aL[i] % aL[j] == 0:
            ans -= 1
            break

print(ans)
from collections import Counter
 
n=int(input())
l=list(map(int,input().split()))
c=Counter(l)
l=sorted([x for x in c])
if l[0]==1: print(1);exit()
sm=0
if c[l[0]]==1: sm+=1
if len(l)==1: print(0);exit()
for i in range(1,len(l)):
    if c[l[i]]>1:continue
    for j in range(i):
        if l[i]%l[j]==0:
            break
    else:sm+=1
print(sm)
import math
from itertools import combinations

n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
pen = 0
nex = n-1
count = 2
ans = 0
com = list(combinations(a,2))

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

for i in range(len(com)):
    pen -= 1

    if com[i][0]%com[i][1] == 0 and pen < 1:
        ans += 1
        pen = nex

    nex -= 1
    if nex < 1:
        nex = n-count
        count += 1

print(n-ans)
import math

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

a.sort()
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)
import bisect

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

for i in range(N - 1,-1,-1):
  sup = A[i] // 2
  if A[i] == A[i - 1]:
    ans -= 1
    continue
  ind = bisect.bisect(A,sup)
  for j in range(0,ind):
    if A[i] % A[j] == 0:
      ans -= 1
      break

print(ans)
N = int(input())

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

B = A[:]
B.sort()
l = []
for i, a in enumerate(A):
  flag = False
  for k, b in enumerate(B):
    if a == b:
      if k == len(B)-1 and flag==False:
        l.append(i+1)
      continue

    if a >= b:
      if a % b == 0:
        flag = True
        break
    else:
      if flag==False:
        l.append(i+1)
      break
    
    if k == len(B)-1 and flag==False:
      l.append(i+1)
 

print(len(l))
n = int(input())
aas = list(set(sorted(list(map(int, input().split())))))
if len(aas) == 1:
    print(0)
    exit()
aas_max = aas[-1]
i = 0
while i != len(aas):
    j = i + 1
    while j != len(aas):
        if aas[j]%aas[i] == 0:
            del aas[j]
        else:
            j += 1
    i += 1
print(len(aas))
#D
import collections
n=int(input())
a_list=list(map(int,input().split()))
a_list.sort()
b_list=collections.Counter(a_list)
b_list=b_list.keys()
j_list=[a_list[0]]
if len(b_list)==1:
    ans=0
elif 1 in a_list:
    ans=1
else:
    ans=1
    for i in a_list:
        for j in j_list:
            if i%j ==0:
                break
        else:
            ans+=1
            j_list.append(i)
            #print(i)
print(ans)
import heapq

n = int(input())
a = [int(i) for i in input().split()]
sa = list(set(a))
heapq.heapify(sa)
div = []
ans = 0
while sa:
    i = heapq.heappop(sa)
    if a.count(i) > 1:
        continue
    div.append(i)
    for d in div:
        if d == i:
            ans += 1
            break
        elif i % d == 0:
            break
print(ans)
n = int(input())
arr = list(map(int, input().split()))

s = {}
max_ele = -10 ** 9
for i in range(n):
    s[arr[i]] = 1
    max_ele = max(max_ele, arr[i])

res = {}
for i in range(n):
    for j in range(arr[i]*2, max_ele + 1, arr[i]):
        if (j in s.keys()):
            res[j] = 1

if len(res) == 0:
    print(len(res))
else:
    print(n-len(res))
import collections
n = int(input())
a = list(map(int, input().split()))
Ca = collections.Counter(a)
# print(Ca.keys())
# print(Ca[2])
m = len(Ca)
# print(Ca, m)
num = [0]*(10**6 + 1)
for i in Ca.keys():
    for j in range(1, 10**6//i + 1):
        num[i*j] += 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 Ca.keys():
    if num[i] < 2:
        ans += Ca[i]

# print(num[:30])
print(ans)
import sys
input = lambda: sys.stdin.readline().rstrip()
n = int(input())
a = list(set(map(int, input().split())))
a.sort()
check = [True for _ in range(10**6 + 5)]
dic = {}
for i in a:
    if i in dic:
        continue
    dic[i] = True
    now = 2 * i
    while (10**6 > now):
        check[now] = False
        now += i

ans = 0
for i in a:
    if check[i] and i not in dic:
        ans += 1
print(ans)
from math import sqrt
from collections import Counter
 
def is_prime(n):
  if n == 1:
    return False
  for i in range(2, int(sqrt(n))+1):
    if n % i == 0:
      return False
  return True

a=int(input())
b=[int(x) for x in input().split()]
b=sorted(b)
d=Counter(b)
c=0
for i in range(0, a):
  if d[b[i]] > 1:
    c+=1
  elif not is_prime(b[i]):
    for j in range(0, i):
      if b[i] % b[j] == 0:
        c+=1
        break
print(a-c)
n = int(input())
n = int(n)

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

length = int(len(num_list))

check_list = [True]*length

for i in range(0, length):
    if check_list[i] == True:
        for j in range(i+1, length):
            if num_list[j] % num_list[i] == 0:
                check_list[j] = False

            if num_list[i] % num_list[j] == 0:
                check_list[i] = False

print(check_list.count(True))
print(check_list)
N=int(input())
Ain=list(map(int,input().split())) 
ans=0
A=set(Ain)
A=list(A)
A.sort()
A2=list(t for t in A)

for i in range(1,len(A)):
    for div in A2:
        if div<A[i] and A[i]%div==0:
            A2.remove(A[i])
            break
        elif div==A[i]:
            ans+=1

if Ain.count(A[0])==1:
    ans+=1

print(ans)
def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True
n=int(input())
A=list(map(int,input().split(" ")))
g=0
for i in range(n):
  if is_prime(A[i]):
    if A.count(A[i])>=2:
      g=g+1
  else:
    for j in range(n):
      if i!=j:
        if A[i]%A[j]==0:
          g=g+1
          break
print(n-g)
N = int(input())
A = sorted(list(map(int, input().split())))
dp = [True for i in range(max(A) + 1)]
dp[0] = False
ans = 0
for i in A:
    for j in range(2, (max(A) // i) + 1):
        if not dp[i * j]:
            continue
        else:
            dp[i * j] = False
for i in range(N):
    if A[i] == A[i - 1]:
        pass
    elif dp[A[i]]:
        ans += 1
print(ans)
n = int(input())
a = list(map(int,input().split()))
a.sort()
ls = [1]*(10**6+1)
ans = 0
for i in a:
  if ls[i] == 0:
    continue
  ans += 1
  for j in range(i,10**6+1,i):
    ls[j] = 0
print(ans)
from collections import Counter
n=int(input())
a=sorted(list(map(int,input().split())))
count=0
b=Counter(a)
count_list=[0]*(10**6)
for i in a:
  if b[i]==1:
    if count_list[i-1]==0:
      count+=1
      j=1
      while i*j<=10**6:
        count_list[i*j-1]+=1
        j+=1
print(count)
n=int(input())
a=sorted(list(map(int,input().split())))[::-1]
ans=0
for i in range(n):
  for j in range(i,n):
    if a[i]%a[j]==0:break
  else:ans+=1
print(ans)
N = int(input())
A = list(map(int, input().split()))

chk_list = sorted(A)
new_list = []
n = 1
while n < len(chk_list):
    new_list = chk_list[:n]
    for i in range(n,len(chk_list)):
        if chk_list[i]%chk_list[n-1] == 0:
            continue
        new_list.append(chk_list[i])
    chk_list = new_list
    new_list = []
    n += 1

if len(chk_list) == 1:
    print(0)
else:
    print(len(chk_list))
n = int(input())
A = list(map(int,input().split()))
a = list(set(A))
c = 0
    

for i in range(len(a)-1):
  k = 0
  for j in range(i+1,len(a)):
    if a[j+k] % a[i] == 0:
      del a[j+k]
      k -= 1
      
for x in a:
  if A.count(x) > 1:
    c += 1
      
print(len(a)-c)
from collections import defaultdict

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

A.sort()
s = A[-1] + 1

dp = ['True'] * s
seen = set()

ans = 0
for i in range(len(A)):
	if i in seen:
		continue
	else:
		seen.add(i)

	x = A[i]
	if dp[x]:
		for y in range(x + x, len(dp), x):
			dp[y] = False

		if i == len(A) - 1:
			if dp[i]:
				ans += 1
		else:
			if x < A[i + 1]:
				ans += 1

print(ans)
n = int(input())
li = list(map(int, input().split()))
li.sort()
inf = (10**6)+1
isprime = [False]*(inf+1)
for i in li:
    isprime[i] = True
for i in range(len(li)):
      if i+1<len(li):
            if li[i] == li[i+1]:
                isprime[li[i]] = False
for i in li:
    if not isprime[i]:
        continue
    for k in range(i+i, inf+1, i):
        isprime[k] = False
prime_list = []
for i in range(1, inf):
    if isprime[i]:
        prime_list.append(i)
print(len(prime_list))
import collections


def main():
    n = int(input())
    al = list(map(int, input().split()))
    al.sort()

    dp = [1]*(10**6+1) 
    for a in al:
        if dp[a]:
            dp[a] -= 1
            for i in range(2,10**6//a + 1):
                dp[a*i] -= 2
    
    ans = 0
    for a in al:
        if dp[a] >= 0: ans+=1
    print(ans)


if __name__ == "__main__":
    main()
N = int(input())
A = list(map(int, input().split()))
A.sort()
B = [0] * (2 * 10 ** 5 + 1)
M = max(A)
N = int(input())
A = list(map(int, input().split()))
ans = 0

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

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

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

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

if N == 1:
  print(1)
  exit(0)
#
A = list(set(A))
N = len(A)
if N == 1:
  print(0)
  exit(0)
#
A.sort()
ans = 0

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

print(ans)
from collections import Counter

N, *A = map(int, open(0).read().split())

ctr = Counter(A)
memo = set()
ans = 0

for a in sorted(A):
    if a == 1:
        ans = 1
        break

    for i in range(1, int(a ** 0.5) + 1):
        if a % i == 0:
            if (i in memo) or (a // i in memo):
                break
    else:
        if ctr[a] == 1:
            ans += 1

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

a.sort()
a_wk = set()
a_wk.add(a[0])

ans = 0
if n == 1 or a[0] < a[1]:
  ans = 1

for i in range(1, n):
  if a[i] == a[i - 1]:
    continue
  if i < n - 1 and a[i] == a[i + 1]:
    continue
  flag = True
  for _a in a_wk:
    if _a * 2 > a[i]:
      break
    if a[i] % _a == 0:
      flag = False
      break
  if flag:
    ans += 1
    a_wk.add(a[i])

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

a.sort()
dp = [1] * n

def div(k):
  global dp
  if dp[k] != 0:
    for i in range(k):
      if a[k]%a[i] == 0:
        dp[k] = 0
        if a[k] == a[i]:dp[i] = 0
        break
    if k < n-1:div(k+1)
n = int(input())
a = list(map(int,input().split()))

a.sort(reverse=True)
cnt = 0
div = False
for i in range(1,len(a)+1):
    div = False
    for j in range(i,len(a)):
        if i-1 == j :
            continue
        if a[i-1] % a[j] == 0:
            div = True
            break
    if div :
        cnt += 1
for i in range(0,len(a)-1):
    if a[n-1] % a[i] == 0:
        cnt += 1
        break

print(n - cnt)
N=int(input())
A=list(map(int,input().split()))
A.sort()
B=[]
for i in range(N-1):
    if A[i]==A[i+1]:
        B.append(A[i])
B=list(set(B))
for i in B:
    A = [x for x in A if x != i]
L=len(A)
for i in range(L):
    if i<len(A):
        for j in range(min(i+1,len(A)-1),len(A)-1):
            if	j<len(A):
            	if A[j]%A[i]==0:
                	A.remove(A[j])
print(len(A))
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:
      break
    cnt += 1
      
print(cnt)
import copy
n = int(input())
a = list(map(int,input().split()))
a.sort()
b = a.copy()
test = [i for i in range(1,n)]
if n > 1:
    if a[0] == a[1]:
        b[0] = 0 

for i in range(n):
    for j in test:
        if b[j] % a[i] == 0:
            b[j] = 0
            test.remove(j)
    if test.count(i+1) != 0:
        test.remove(i+1)


print(n - b.count(0))
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
count = 0
for x in new_array:
    if x == True:
        count+=1
print(N-count)
from collections import Counter
n = int(input())
a= list(map(int,input().split()))
if n == 1:
  print(1)
  exit()

a.sort()
if a[0] == 1:
  print(1)
  exit()

c = Counter(a)
a = list(set(a))
dp = [0] * (10**6 +1)

for x in a:
  t = x * 2
  while t <= 10**6:
    dp[t] = 1
    t += x

ans = 0
for x in a:
  if (c[x] == 1) & (dp[x] == 0):
    ans += 1

print(ans)
from collections import defaultdict
import numpy as np

def main():
    MOD = 10**9+7
    n = int(input())
    A = list(map(int,input().split()))

    A.sort()
    T = A[-1]+1

    dp = [True] * T

    d = defaultdict(int)

    for a in A:
        d[a] += 1
        if dp[a]:
            for j in range(2*a,T,a):
                dp[j] = False

    ans = 0
    
    for a in A:
        if d[a] == 1 and dp[a] == True:
            ans += 1

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

for i in range(N):
    for j in range(1, N-i):
        if A[i]%A[j]==0 or A[j]%A[i]==0:
            count += 1
        # print(i+j)
    # print("---")
print(count-1)
import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
a.sort()

flg = [True for _ in range(10 ** 6 + 1)]
for i in range(n-1):
    if a[i] == a[i+1]:
        flg[a[i]] = False

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

        tmp = 1
        while tmp * a[i] <= 10 ** 6:
            flg[tmp * a[i]] = False
            tmp += 1

print(ans)
def solution():
    _ = input()
    user_input = input()
    num_list = [int(x) for x in user_input.split()]

    iter = max(num_list) // min(num_list) 

    h = {}
    for num in num_list:
        h[num] = 0
    
    multiplier = 1
    for _ in range(iter):
        for num in h:
            if num * multiplier in h:
                h[num * multiplier] += 1
        multiplier += 1
    
    result = 0
    for _, val in h.items():
        if val == 1:
            result += 1
    print(result)

solution()
n = int(input())
a = list(map(int,input().split()))
a.sort()
c = list(range(n))
for i in range(n):
    for k in c:
        if(i != k):
            if(a[k] % a[i]==0):
                c.remove(k)
print(len(c))
n = int(input())
list_ = list(map(int, input().split()))
set_ = set(list_)
cnt = 0

for i in range(len(set_)):
    flag = True
    for j in range(n):
        if i == j:
            continue

        if list_[i] % list_[j] == 0:
            flag = False
            break

    if flag:
        cnt += 1

print(cnt)
n = int(input())
a = list(map(int,input().split()))
a.sort()
divs = [a[0]]
idx=1
v = a[0]
t = a[-1]**(1/2)
while v<t and idx<n:
  if all([a[idx]%d!=0 for d in divs]):
    divs.append(a[idx])
  v = a[idx]
  idx += 1
for i in range(n):
  if all(a[i]!=d and a[i]%d!=0 for d in divs):
    divs.append(a[i])
if len(divs)==1:
  if all(p%divs[0]!=0 for p in a[1:]):
    print(len(divs)+1)  
  else:
    print(0)
else:
  print(len(divs))
import collections
n = int(raw_input())
ais = map(int,raw_input().split())
ais.sort()
cc = collections.Counter(ais)
s = {ai:True for ai in ais}
m = max(ais)
for a in cc:
	c = a if cc[a] > 1 else 2 * a
	while(c <= m):
		if a in s: s[a] = False
		c+= a
count = 0
for ai in s:
	if s[ai]:
		count +=1
print count
import numpy as np
n = int(input())
p = list(map(int,input().split()))
p.sort(reverse=True)
count=0
if np.unique(p).size >1:
    count +=1
for i in range(len(p)):
    for j in reversed(range(i+1,len(p))):
        if p[i]< p[j]*2 and not p[i]==p[j]:
            count +=1
            break
        if p[i]%p[j] ==0:
            break
        if j == i+1:
            count +=1
if count >=1:
    print(count)
else:
    print(count)
n = int(input())
alist = list(map(int, input().split(" ")))
settle = list(set(alist))

for i in settle:
  for j in alist:
    if j%i==0 and j//i>=2:
      alist.remove(j)

for m in alist:
  if alist.count(m)>=2:
    for k in range(alist.count(m)):
      alist.remove(m)
print(len(alist))
from collections import deque as dq
import sys
input = sys.stdin.readline


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


    while A:
        start = A.popleft()
        if not A:
            break
        ans += 1
        A = dq([a for a in A if a % start != 0])

    print(ans)

    
if __name__ == '__main__':
    main()
import numpy as np
n = int(input())
p = list(map(int,input().split()))
p.sort(reverse=True)
count=0
if np.unique(p).size >1:
    count +=1
for i in range(len(p)):
    for j in reversed(range(i+1,len(p))):
        if p[i]%p[j] ==0:
            break
        if j == i+1:
            count +=1
if count >=1:
    print(count)
else:
    print(count)
n=int(input())
a=list(map(int, input().split()))
a=sorted(a)
dp=[True]*a[-1]
for i in range(n):
    if i!=n-1:
      if a[i]==a[i+1]:
        dp[a[i]-1]=False
        dp[a[i+1]-1]=False
        continue
    if not dp[a[i]-1]:
      continue
    k=2
    while a[-1]>=k*a[i]:
        dp[k*a[i]-1]=False
        k+=1
ans=0
for i in range(n):
    if dp[a[i]-1]:
        ans+=1
print(ans)