import numpy as np



N = int(eval(input()))

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

Amax = max(A)

dp = np.ones(Amax, dtype=bool)

appear = np.zeros(Amax, dtype=int)

for a in A:

  appear[a-1] += 1



for i in range(1, len(dp)+1):

  if not dp[i-1]:

    continue

  if appear[i-1] != 0:

    j = 2

    while j * i <= Amax:

      dp[j * i - 1] = False

      j += 1

# print(dp)



app_set = set([])

dup_set = set([])

count = 0

for a in A:

  if appear[a-1] > 1:

    continue

  else:

    count += dp[a-1]

print((count -  len(dup_set)))



import numpy as np



N = int(eval(input()))

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

Amax = max(A)

dp = np.ones(Amax, dtype=bool)

appear = np.zeros(Amax, dtype=int)

for a in A:

  appear[a-1] += 1



for i in range(1, len(dp)+1):

  if not dp[i-1]:

    continue

  if appear[i-1] != 0:

    j = 2

    while j * i <= Amax:

      dp[j * i - 1] = False

      j += 1



count = 0

for a in A:

  if appear[a-1] > 1:

    continue

  else:

    count += dp[a-1]

print(count)

import numpy as np

N = int(eval(input()))
A = list(map(int, input().split(" ")))
Amax = max(A)
dp = np.ones(Amax, dtype=bool)
appear = np.zeros(Amax, dtype=int)
for a in A:
    appear[a - 1] += 1
for i in range(1, len(dp) + 1):
    if not dp[i - 1]:
        continue
    if appear[i - 1] != 0:
        j = 2
        while j * i <= Amax:
            dp[j * i - 1] = False
            j += 1
# print(dp)
app_set = set([])
dup_set = set([])
count = 0
for a in A:
    if appear[a - 1] > 1:
        continue
    else:
        count += dp[a - 1]
print((count - len(dup_set)))

import numpy as np

N = int(eval(input()))
A = [int(x) for x in input().split(" ")]
Amax = max(A)
dp = np.ones(Amax, dtype=bool)
appear = np.zeros(Amax, dtype=int)
for a in A:
    appear[a - 1] += 1
for i in range(1, len(dp) + 1):
    if not dp[i - 1]:
        continue
    if appear[i - 1] != 0:
        j = 2
        while j * i <= Amax:
            dp[j * i - 1] = False
            j += 1
count = 0
for a in A:
    if appear[a - 1] > 1:
        continue
    else:
        count += dp[a - 1]
print(count)

-A = list(map(int, input().split(" "))) +A = [int(x) for x in input().split(" ")] -# print(dp) -app_set = set([]) -dup_set = set([]) -print((count - len(dup_set))) +print(count)