peterverebics/CodeNet_Python_118 huggingface dataset:
# 初期入力
import numpy as np
import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
A.sort()
A_set =set(A)
A_np =np.array(A,dtype=np.int64)
count =set()
for i in range(N):
    a_mod =np.where(A_np %A_np[i] ==0)
    aa =A_np[a_mod]
    a_self =np.where(aa==A_np[i])  
    a_count =np.delete(aa,a_self)
    a_count = a_count.tolist()
    count |= set(a_count)      
ans =len(A_set - count)
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())
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]:
                if p[j] % p[i] == 0:
                    tp[j] = 0
print(sum(tp))
import math

n=int(input())

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

count=0
isDividable=0

for i in range(n):
  isDividable=0
  l=a[i]/2
  for j in range(n):
    if i != j and a[j] <= l and a[i] % a[j] == 0:
      isDividable=1
      break
  if isDividable==0:
    count=count+1
print(count)
import copy

n = int(input())
a = [int(item) for item in input().split()]

a.sort()

b = copy.deepcopy(a)
flag = []
num = []

for i in range(n):
    if i in flag:
        continue
    for j in range(i+1, n):
        if j in flag:
            continue
        if a[j] % a[i] == 0 and a[j] in b:
            flag.append(j)
            continue
        num.append(a[j])

print(len(num))
N=int(input())
a=list(map(int, input().split()))
A=list(set(a))
A.sort(reverse=True)
if len(A) ==1:
    c=0
else:
    c=len(A)

# print(A)
for i in range(len(A)-1):
    for j in range(i+1,len(A)):
        if A[i] % A[j] == 0:
            c-=1
            break
print(c)
import sys

N = int(input())


if N == 1:
    print(int(input()))
    sys.exit()

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

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

count = 1
A = sorted(A)
B = [A[0]]

for i in range(len(A)-1):
    Flag = True
    for j in B:
        if A[i+1] % j == 0:
            Flag = False
    if Flag == True:
        B.append(A[i+1])

print(len(B))
N = int(input())
A_n = sorted(list(set(map(int, input().split(' ')))), reverse=True)
if len(A_n) == 1:
    print('0')
else:
    count = len(A_n)
    for i in range(len(A_n)-1):
        for j in range(i+1, len(A_n)):
            if A_n[i]%A_n[j] == 0:
                # print(str(A_n[i]) + ' ' + str(A_n[j]))
                count -= 1
                break
    print(count)
n = int(input())
a = list(map(int, input().split()))

a.sort()
cnt = 0
dp = [True] * (a[-1]+1)
pre = -1
flg = False

for i in a:
    if dp[i] == True:
        cnt += 1
    if i == pre:
        if flg is True:
            continue
        else:
            cnt -= 1
            flg = True
    else:
        flg = False
        for j in range(1, a[-1]//i+1):
            dp[i*j] = False
    pre = i

print(cnt)
N = int(input())
A = list(map(int,input().split()))
A.sort()
NG = [x for x in set(A) if A.count(x) > 1]
A = list(set(A))

sum = 0

while True:
    X = A.pop(0) #左端をとる
    
    i = len(A)
    for Y in reversed(A):
        i -= 1

        if Y%X == 0:
            A.pop(i)

    if NG.count(X) == 0:
        sum += 1

    if len(A) == 0:
        break

print(sum)
import sys

def input():
    return sys.stdin.readline().strip()

def main():

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

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

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

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

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

MAX_N = max(A)+1
cnt = [0] * MAX_N 

for a in A:
  for i in range(a, MAX_N, a):
    if cnt[i] >= 2: break 
    cnt[i] += 1
      
ans = 0
for a in A:
  if cnt[a] == 1: ans += 1
print(ans)
N = int(input())
#N = map(int,input().split())
A = list(map(int,input().split()))
A.sort()

count = 0
for i in range(1, N):
    B = A[:i]
    a = A[i]
    bit = 0
    for b in B:
        if a%b == 0:
            bit = 1
            break
    if bit == 0:
        count+=1
if A[0] not in A[1:]:
    count+=1
print(count)
n = int(input())
lst = list(map(int,input().split()))
dct = {}
for i in lst:
    dct[i] = dct.get(i, 0) + 1
ans = 0
for i in dct:
    ans += (dct[i] == 1)
print(ans)
n = int(input())
a = list(map(int, input().split()))

MAX = 1000005
cnt = [0] * MAX
for x in a:
    if cnt[x] != 0:
        continue
    #cnt配列の各倍数のところに+1
    for i in range(x, MAX, x):
        cnt[i] += 1
ans = 0
for x in a:
    if cnt[x] == 1:
        ans += 1

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

res = 0
for i in range(n):
    for j in range(n):
        if  i == j:
           pass
        elif (a[i] == a[j]) or (a[i]%a[j] == 0):
            break

    else:
        res += 1
lst=[]
c=0
flag=0
n = int(input())
str = input()
lst = str.split(' ')
#for i in range(0,n):
#  lst[i] = int(lst[i])
lst.sort()
#print(lst)
for i in range(0,n):
  flag=0
  if i+1<n:
    if int(lst[i+1])==int(lst[i]):
      flag=1
  for j in range(0,i):
    
    if  int(lst[i])%int(lst[j])==0:
      flag=1
      j=i
  if flag==0:
    c = c+1
print(c)
n = int(input())
a = list(map(int, input().split()))
a.sort()
flag = [True] * n
for i, num in enumerate(a):
    if num > a[-1]*0.5:
        break
    if a[(i-1)%n]==num or a[(i+1)%n]==num:
        flag[i] = False
        continue
    for j in range(i+1, n):
        if a[j]%num==0:
            flag[j] = False
counter = 0
#print(flag)
for i in range(len(flag)):
    if flag[i]:
        counter += 1
print(counter)
def divisor(n):
    d = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            d.append(i)
            if i ** 2 == n:
                continue
            d.append(n // i)
    return d

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

dup = [x for x in set(A) if A.count(x) > 1]
A_dif = set(A) - set(dup)

cnt = 0
for a in A_dif:
    tmp = set(divisor(a)) & set(A_dif)
    if len(tmp) == 1: cnt += 1

print(cnt)
N=int(input())
A= list(map(int,input().split()))
value_count=0
for i in range(N):
    for j in range(N):
        if(i!=j):
            if(A[i]%A[j]!=0):
                if(j==N-1):
                    value_count += 1
            else:
                break
print(value_count)
from collections import Counter

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

c = Counter(a)
new = []
for key, val in c.most_common():
    if val == 1:
        new.append(key)

ans = 0
for i in range(len(new)):
    flag = True
    for j in range(len(new)):
        if i != j and new[i] % new[j] == 0:
            flag = False
            break

    if flag:
        ans += 1

print(ans)
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)
lst=[]
c=0
flag=0
n = int(input())
str = input()
lst = str.split(' ')
#for i in range(0,n):
#  lst[i] = int(lst[i])
lst.sort()
#print(lst)
for i in range(0,n):
  flag=0
  for j in range(0,i):
    
    if  int(lst[i])%int(lst[j])==0:
      flag=1
      j=i
  if flag==0:
    c = c+1
print(c)
n = int(input())
a = list(map(int, input().split()))
a = list(set(a))
a.sort()
p = []

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

for a_i in a:
    if not p:
        p.append(a_i)
        continue
    warikireru = False
    for p_i in p:
        if a_i%p_i == 0:
            warikireru = True
            break
    if warikireru:
        continue
    else:
        p.append(a_i)

print(len(p))
import sys
input = sys.stdin.readline

n = int(input())
a = [int(x) for x in input().split()]
maxval = 10 ** 6 + 5
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
    if 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)
import math
N = int(input())
A = list(map(int, input().split()))

A.sort()

se = set(A)
if len(se) == 1 and N > 1:
    print(0)
    exit()

for i in range(N):
    tmp = set()
    for s in se:
        if s == A[i] or s % A[i] != 0:
            tmp.add(s)
    se = tmp

print(len(se))
N = input()
A = list(map(int, input().split()))
A.sort()
first = A[0]

cnt = 0

while cnt < len(A):
  div = A[cnt]
  for l in range(cnt):
    if div%A[l] == 0:
      continue
  delete_index = []
  for k in range(cnt+1, len(A)):
    amari = A[k] % div
    if amari == 0:
      delete_index.append(k)
  for j in sorted(delete_index, reverse=True):
    A.pop(j)
  cnt += 1

if len(A)==1 and A[0]==first:
  print(0)
else:
  print(len(A))
n = int(input())
a = list(map(int, input().split()))
a.sort()
l = [True] * (10**6 + 1)
cnt = 0
for i in range(n):
  d = a[i]
  if l[d]:
    if i < n-1 and a[i] != a[i+1]:
      cnt += 1
    elif i == n-1:
      cnt += 1
    for j in range(d, 10**6 + 1, d):
      l[d] = False
print(cnt)
N = int(input())
good = N
i = 0
A = [int(x) for x in input().split()]
A.sort(reverse=True)
for i in range(N):
    if A[i]==A[i-1]:
        good -= 1
        continue
    for j in range(i+1,N):
        if A[i]%A[j]==0:
            good -= 1
            break
print(good)
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:
        if l[i] > 1:
            continue
        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()
n = int(input())
a_ls = list(map(int, input().split()))
a_ls.sort(reverse=True)
ans = 0
for i in range(n):
    not_divisible = True
    for j in range(i+1,n):
        if a_ls[i] % a_ls[j] == 0:
            not_divisible = False
            break
    if not_divisible:
        ans += 1
if n > 1 and a_ls[-2] == a_ls[-1]:
    ans -= 1
print(ans)
MAXA = 10**5+1
N = int(input())
A = list(map(int,input().split()))
A.append(MAXA)
A.sort()
hurui = [0]*(max(A)+2)
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,max(A),a):
        if hurui[i]:
            break
        hurui[i] += 1

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

alist.sort()
#print(alist)
if alist.count(alist[0])==1:
    ans=1
else:
    ans=0
for i in range(1,N):
    a=alist[i]
    aaa=[a]*(i)
    x=np.array(aaa)
    y=np.array(alist[0:i])
    amari=x%y
    #print(x)
    #print(y)
    #print(amari)
    if list(amari).count(0)==0:
        ans+=1
print(ans)
# coding: utf-8
N = int(input())
li = [True for _ in range(0, 10**6 + 1)]
A = list(map(int, input().split()))
A.sort()
ans = 0
for i in range(N):
    if li[A[i]]:
        ans += 1
    else:
        continue
    for j in range(A[i], 10**6 + 1, A[i]):
        li[j] = False
ans -= len(A) - len(set(A))
if N == 1:
    ans = 0
print(max(0, ans))
n = int(input())
A = sorted(map(int, input().split()), reverse=True)
b = 0
#print(A)
for i in range(n):
  if i != 0:
    if A[i] == A[i-1]:
      continue
#  j = i+1
  if i == n-1:
    b += 1
    continue
  j = n-1
  while j > i:
    if A[i]%A[j] == 0:
      break
    if j == i+1 or 2*A[j] > A[i]:
      b += 1
      break
    j -= 1
print(b)
n = int(input())
a = sorted(list(map(int, input().split())))

res = 0
for i in range(n):
    for j in range(i):
        if a[j] * 2 > a[i]:
            break
        if a[i] % a[j] == 0:
            res += 1
            break

print(n - res)
import math

n=int(input())
A=list(map(int,input().split()))
A.sort()
m=10**6+10
C=[0]*m
C[0]=-1
ans=0
now=0
flag=0
for a in A:
    if now==a:
        flag=1
        continue
    if now!=a and flag:
        ans-=1
        flag=0
    now=a
    if C[a]==0:
        ans+=1
        j=a
        while j<m:
            C[j]=1
            j+=a
if flag:
    ans-=1
print(ans)
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
C = Counter(A).most_common()

MAXN = pow(10,6)
B = [False]*(MAXN+1)
for c in C:
    if c[1] == 1:
        B[c[0]] = True

ans = 0
for i in range(MAXN + 1):
    if B[i]:
        ans += 1
        B[i::i] = [False]*(MAXN//i)
print(ans)
n = int(input())
A = sorted(list(map(int, input().split())))

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

from collections import Counter
c = Counter(A)

NMAX = 10 ** 6 + 1000
dp = [True] * (NMAX + 1)
for k, v in c.items():
    if dp[k]:
        for i in range(k * 2, NMAX + 1, k):
            dp[i] = False
    if v > 1:
        dp[k] = False

count = 0
for k, v in c.items():
    if v > 1: continue
    if dp[k]: count += 1

print(count)
d=[0]*8**7
for i in[*open(0)][1].split():d[int(i)]+=1
i=r=0
while i<1e6:
 i+=1;r+=d[i]==1;j=i
 while j<1e6:j+=i;d[j]&=d[i]<1
print(r)
N = int(input())
A = list(map(int, input().split()))

import numpy as np

ans = 0
for i in range(N):
    if A.count(A[i]) == N:
        ans = 0
        break
        break
    c = [j for j in A[i]/np.array(A) if j.is_integer() ]
    if len(c) == 1:
        ans += 1
print(ans)
import collections

def main():
  n = int(input())
  A = tuple(map(int, input().split()))
  D = collections.defaultdict(int)
  for a in A:
    D[a] += 1

  ans = n

  for i in range(n):
    a = A[i]
    for j in range(1, a // 2 + 1):
      if j not in D:
        continue

      if a == j and D[a] == 1:
        continue

      if a % j == 0:
        ans -= 1
        break

  print(ans)


main()
import numpy as np
 
N = int(input())
x_list = np.array(list(map(int, input().split()))).reshape(1,N)
#count = np.sum(x_list%x_list.reshape(N,1)==0, axis=0)==1
#print(np.sum(count))
from collections import Counter

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

prime = [True for i in range(10**6)]

for a in A:
    if(prime[a-1]):
        for j in range(a*2, 10**6, a):
            prime[j-1] = False

cnt = 0
for i in A:
    if(prime[i-1]):
        cnt += 1
        
c = Counter(A)
cc = sorted(c.items(), key=lambda x:x[1], reverse=True)

if(N == len(cc)):        
    print(cnt)
else:
    print(cnt-(N-len(cc)-1))
from collections import Counter

def undivisible(A):
    m = max(A)
    dp = [True] * (m+1)
    A.sort()
    for a in A:
        if dp[a]:
            k = a * 2
            while k <= m:
                dp[k] = False
                k += a
    cnt = Counter(A)
    ans = 0
    for a in A:
        if dp[a] and cnt[a] == 1:
            ans += 1
    return ans

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

y.sort()
ans = []
while len(y) != 0:
    judge = y.pop(0)
    remove = []
    if len(y) == 0:
        ans.append(judge)
        break;
    if judge != y[0]:
        ans.append(judge)
    for i in y:
        if i % judge == 0:
            remove.append(i)
    y = list(set(y) - set(remove))
        
print(len(ans))
N= int(input())
As = list(map(int,input().split()))
As= [a for a in As if As.count(a)==1]
As.sort()
import sys
if len(As)==0:
    print(0)
    sys.exit()
count=1
for i in range(1,len(As),-1):
    flg=True
    for j in range(i):
        if As[i]%As[j]==0:
            flg=False
            break
        if As[j]>As[i]**0.5:
            break
    if flg:
        count +=1
print(count)
import numpy as np
n = int(input())
a = np.sort(np.array([int(x) for x in input().split()]))
max_num = np.max(a)+1
dp = np.array([True]*(max_num))

if np.all(a==a[0]):
    print(0)
elif np.count_nonzero(a==1)  == 1:
    print(1)
else:
    for i in range(1,max_num):
        if dp[i] and i in a:
            for j in np.arange(i*2, max_num, i):
                dp[j] = False
    print(dp)
    print(np.count_nonzero(dp[a] == True))
n = int(input())
a = list(map(int, input().split()))
a.sort()
cnt = [0] * ((10 ** 6) + 1)

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

unique = []

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

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

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

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

print(ans)
n=int(input())
a=[int(x) for x in input().split()]
a.sort()
p=[]
q=0
for c in a:
    t=0
    for d in p:
        if c%d==0:
            t=1
            break
    if t==0:
        q+=1
        p.append(c)
print(q)
N = int(input())
p = list(map(int, input().split()))
p.sort(reverse=True)
lst = p[:]
jdg = True
temp = p[:]
ans = 0
while temp:
    lst = []
    q = temp.pop()
    for i in temp:
        if i%q!=0: lst.append(i)
        if i==q:jdg=False
    if jdg:
        ans += 1
    temp = lst[:]

print(ans)
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse = True)
ans = 0
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:
		ans += 1

print(ans)
from collections import Counter

input()
s = set(map(int, input().split()))
t = {k for k, v in Counter(s).items() if v == 1} 
r = int(1 in t)
if 1 not in s:
  for x in t:
    i = 2
    while i * i <= x:
      if x % i == 0 and  {i, x // i} & s:
        break
      i += 1
    else:
      r += 1
print(r)
N = int(input())
A = [int(x) for x in input().split()]
ans = 0
for i in range(N):
    count = 0
    for j in range(N):
        if A[i]%A[j] != 0 and i != j: 
            count += 1
            if count == N-1:
                ans += 1

print(ans)
n = int(input())
A = sorted(map(int, input().split()))
if len(set(A)) == 1:
    print(0)
    exit()
ans = 0
used = set()
for a in A:
    if any(a % x == 0 for x in used):
        continue
    ans += 1
    used.add(a)
print(ans)
import sys
from itertools import groupby

readline = sys.stdin.buffer.readline
a = map(int, readline().split())
b = list(map(int, readline().split()))
b.sort(reverse=True)
print(b)

x = len(b)
c = [(k, len(list(L))) for k, L in groupby(b)]
# print(c)
for i, v in enumerate(c):
  if v[1] > 1:
    x -= v[1]
    break
  for vv in c[i+1:]:
    if not v[0] % vv[0]:
      x -= 1
      break
print(x)
from collections import deque,Counter
import bisect
n,*a = map(int,open(0).read().split())
c = Counter(a)
c = sorted(c.items())
a = deque(c)
p_set = set()
ans,r = 0,0
while a:
    f,count = a.popleft()
    if count == 1:
        z = []
        for u in range(len(a)):
            if a[u][0]%f != 0:
                z.append(a[u])
        a = deque(z[:])
    else:
        r += 1
    p_set.add(f)
print(len(p_set)-r)
from sys import stdin
data = stdin.readlines()

n = int(data[0].split()[0])
a = [int(s) for s in data[1].split()]
a = sorted(a)

max = a[-1]
print(max)

l = [0]*(max+1)

for i in a:
    l[i] += 1
    if l[i] == 1:
        for j in range(i*2,max+1,i):
            l[j] = 2
print(l.count(1))
n = int(input())
a = list(map(int, input().split( )))

count = 0

for i in a:
    a_ = [t % i for t in a]
    c = a_.count(0)
    
    if c == 1:
        count += 1
print(count)
n = int(input())
A = list(map(int,input().split()))
i = 0
ans = 0 
A.sort()
A.reverse()
if A[n-1] == 1:
    if A[n-2] != 1:
        print(1)
        exit()
    else:
        print(0)
        exit()
while i <= n-2:
    for j in range(i+1,n):
        if A[i] % A[j] == 0:
            break
        elif j == n - 1:
            ans = ans + 1
    i = j + 1
if A[n-1] == A[n-2]:
    print(ans)
else:
    print(ans+1)
n = int(input())
p = list(map(int,input().split()))
p.sort(reverse=True)
count=0
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+1)
else:
    print(count)
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    ans = 1
    A = sorted(A)
    if len(set(A)) == len(A):
        for i in range(1, N):
            count = 0
            for j in range(i):
                if A[i] % A[j] == 0:
                    count += 1
            if count == 0:
                ans += 1
        print(ans)
    else:
        print("0")
resolve()
#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(set(counter)))
import math

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

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

d = set()
for a in aL:
    d.add(a)
if len(d) == 1 and n != 1:
    print(0)
    exit()

print(ans)
N = int(input())
a = [int(x) for x in input().split()]
from collections import defaultdict
d = defaultdict(int)
ans = 0
for i in range(N):
    d[a[i]] += 1
for i in range(1,1001):
    if d[i] == 1:
        ans += 1
        for j in range(2,2+10**6//i):
            d[j*i] = 0
    elif d[i] >= 2:
        for j in range(2,2+10**6//i):
            d[j*i] = 0
for i in range(1001,1000001):
    if d[i] >= 1:
        ans += 1
print(ans)
n = int(input())
p = list(map(int,input().split()))
p.sort(reverse=True)
count=0
for i in range(len(p)):
    for j in reversed(range(i+1,len(p))):
        if p[i]%p[j] ==0:
            break
        if j == len(p)-1:
            count +=1



if count >=1:
    print(count+1)
else:
    print(count)
num = int(input())
A = [int(i) for i in input().split(" ")]

A = sorted(A)
num = len(A)

res = 1
if len(A) > 1 and A[0] == A[1]:
  res = 0
i = 1
while i < num:
  divisible = False
  for j in range(i):
    if A[i] % A[j] == 0:
      divisible = True
      A.pop(i)
      num -= 1
      i -= 1
      break
  i += 1

  if not divisible:
    res += 1
print(res)
import copy 

N=int(input())
A=list(map(int,(input().split())))
new_A=list(set(A))
new_A.sort()
tmp_A = copy.copy(new_A)
count=0
try:
  for i in new_A[:]:
    tmp_A.remove(i)
    for j in tmp_A[:]:

      if(i%j==0):
        new_A.remove(i)
    tmp_A=copy.copy(new_A)

  if(len(new_A)==1):
    print(0)
  else:
    print(len(new_A))
except:
  print(len(new_A))
import numpy as np
import collections

n = int(input())
aa = np.array(list(map(int,input().split())))
c = collections.Counter(aa)
a=np.unique(aa)
amax=max(a)+1
ah=[0]*amax

for i in a:
    if c[i]>=2 and ah[i]==0:
        ah[i]=2
        continue
    for j in range(i,amax,i):
        ah[j]+=1

an=0
for i in a:
    if ah[i]==1:
        an+=1
print(an)
N = int(input())
A = list(map(int, input().split()))
flag_lst = [0]*N

for i in range(N):
    for j in range(N):
        if flag_lst[j] >= 1:
            pass
        else:
            if A[j] % A[i] == 0:
                flag_lst[j] += 1

res = 0
for flag in flag_lst:
    if flag == 1:
        res += 1

print(res)
import numpy as np
n = int(input())
a = list(map(int,input().split()))

a.sort()
na = np.array(a)
#for i in na:
cnt = 0
while cnt < len(a):
    #na = na[na % i != 0]
    tmp = na[0]
    na = na[na % a[cnt] != 0]
    #print(na)
    na = np.append(na, tmp)
    #print(na)
    cnt +=1


ans = len(set(na))
if ans == 1:
    print(0)
    exit()

print(ans)
N = int(input())
l = [int(x) for x in input().split()] + [100001]
l.sort()
ans = 0
t = 0
M = [False] * 10 ** 6
for i in range(N):
    if not M[l[i]-1]:
        if l[i] != l[i+1]:
            ans += 1
        t = l[i]
        while t <= 10 ** 6:
            M[t-1] = True
            t += l[i]
print(ans)