n=int(eval(input()))

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

if n!=1 and len(set(a))==1:

  print((0))

  exit()

l=[0 for i in range(10**6+1)]

for i in range(n):

  l[a[i]]+=1

if n!=1 and min(a)>max(a)/2:

  ct=0

  for i in range(len(l)):

    if l[i]==1:

      ct+=1

  print(ct)

  exit()

d={}

ans=0

for i in range(n):

  x=a[i]

  if x not in d:

    if l[a[i]]==1:

      flag=1

      for j in range(1,int(x**0.5)+2):

        if x%j==0:

          if x!=j and l[j]>0:

            flag=0

            break

          if x!=x//j and x%(x//j)==0 and l[x//j]>0:

            flag=0

            break

      if flag==1:

        ans+=1

        d[x]=1

      else:

        d[x]=0

  else:

    ans+=d[x]

print(ans)
n=int(eval(input()))

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

a.sort()

ct=[0 for i in range(10**6+1)]

check=[0 for i in range(10**6+1)]

dp=[1 for i in range(10**6+1)]

for i in range(n):

  ct[a[i]]+=1

  if check[a[i]]==0:

    check[a[i]]=1

    for j in range(2,10**6+1):

      if a[i]*j<=10**6:

        dp[a[i]*j]=0

      else:

        break

ans=0

for i in range(n):

  if ct[a[i]]==1 and dp[a[i]]==1:

    ans+=1

print(ans)
n = int(eval(input()))
a = list(map(int, input().split()))
if n != 1 and len(set(a)) == 1:
    print((0))
    exit()
l = [0 for i in range(10**6 + 1)]
for i in range(n):
    l[a[i]] += 1
if n != 1 and min(a) > max(a) / 2:
    ct = 0
    for i in range(len(l)):
        if l[i] == 1:
            ct += 1
    print(ct)
    exit()
d = {}
ans = 0
for i in range(n):
    x = a[i]
    if x not in d:
        if l[a[i]] == 1:
            flag = 1
            for j in range(1, int(x**0.5) + 2):
                if x % j == 0:
                    if x != j and l[j] > 0:
                        flag = 0
                        break
                    if x != x // j and x % (x // j) == 0 and l[x // j] > 0:
                        flag = 0
                        break
            if flag == 1:
                ans += 1
                d[x] = 1
            else:
                d[x] = 0
    else:
        ans += d[x]
print(ans)

n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
ct = [0 for i in range(10**6 + 1)]
check = [0 for i in range(10**6 + 1)]
dp = [1 for i in range(10**6 + 1)]
for i in range(n):
    ct[a[i]] += 1
    if check[a[i]] == 0:
        check[a[i]] = 1
        for j in range(2, 10**6 + 1):
            if a[i] * j <= 10**6:
                dp[a[i] * j] = 0
            else:
                break
ans = 0
for i in range(n):
    if ct[a[i]] == 1 and dp[a[i]] == 1:
        ans += 1
print(ans)

-if n != 1 and len(set(a)) == 1: -    print((0)) -    exit() -l = [0 for i in range(10**6 + 1)] +a.sort() +ct = [0 for i in range(10**6 + 1)] +check = [0 for i in range(10**6 + 1)] +dp = [1 for i in range(10**6 + 1)] -    l[a[i]] += 1 -if n != 1 and min(a) > max(a) / 2: -    ct = 0 -    for i in range(len(l)): -        if l[i] == 1: -            ct += 1 -    print(ct) -    exit() -d = {} +    ct[a[i]] += 1 +    if check[a[i]] == 0: +        check[a[i]] = 1 +        for j in range(2, 10**6 + 1): +            if a[i] * j <= 10**6: +                dp[a[i] * j] = 0 +            else: +                break -    x = a[i] -    if x not in d: -        if l[a[i]] == 1: -            flag = 1 -            for j in range(1, int(x**0.5) + 2): -                if x % j == 0: -                    if x != j and l[j] > 0: -                        flag = 0 -                        break -                    if x != x // j and x % (x // j) == 0 and l[x // j] > 0: -                        flag = 0 -                        break -            if flag == 1: -                ans += 1 -                d[x] = 1 -            else: -                d[x] = 0 -    else: -        ans += d[x] +    if ct[a[i]] == 1 and dp[a[i]] == 1: +        ans += 1