def main():

  n = int(eval(input()))

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



  ans = [0] * (max(a) + 1)

  length = max(a) + 1

  for x in a:

    if ans[x] == 0:

      for j in range(x, length, x):

        ans[j] += 1

    else:

      ans[x] += 1



  print((len(list([x for x in a if ans[x] == 1]))))



  

if __name__ == '__main__':

  main()
import sys

input = sys.stdin.readline

import math

 

def INT(): return int(eval(input()))

def MAPINT(): return list(map(int, input().split()))

def LMAPINT(): return list(map(int, input().split()))

def STR(): return eval(input())

def MAPSTR(): return list(map(str, input().split()))

def LMAPSTR(): return list(map(str, input().split()))

 

f_inf = float('inf')

 

n = INT()

a = sorted(LMAPINT())



length = (max(a) + 1)



ans = [0] * length

for x in a:

  # 重複

  if ans[x] != 0:

    ans[x] = 2

    continue

  for j in range(x, length, x):

    ans[j] += 1

 

count = 0

for x in a:

  if ans[x] == 1:

    count += 1

print(count)
def main():
    n = int(eval(input()))
    a = list(map(int, input().split()))
    ans = [0] * (max(a) + 1)
    length = max(a) + 1
    for x in a:
        if ans[x] == 0:
            for j in range(x, length, x):
                ans[j] += 1
        else:
            ans[x] += 1
    print((len(list([x for x in a if ans[x] == 1]))))


if __name__ == "__main__":
    main()

import sys

input = sys.stdin.readline
import math


def INT():
    return int(eval(input()))


def MAPINT():
    return list(map(int, input().split()))


def LMAPINT():
    return list(map(int, input().split()))


def STR():
    return eval(input())


def MAPSTR():
    return list(map(str, input().split()))


def LMAPSTR():
    return list(map(str, input().split()))


f_inf = float("inf")
n = INT()
a = sorted(LMAPINT())
length = max(a) + 1
ans = [0] * length
for x in a:
    # 重複
    if ans[x] != 0:
        ans[x] = 2
        continue
    for j in range(x, length, x):
        ans[j] += 1
count = 0
for x in a:
    if ans[x] == 1:
        count += 1
print(count)

-def main(): -    n = int(eval(input())) -    a = list(map(int, input().split())) -    ans = [0] * (max(a) + 1) -    length = max(a) + 1 -    for x in a: -        if ans[x] == 0: -            for j in range(x, length, x): -                ans[j] += 1 -        else: -            ans[x] += 1 -    print((len(list([x for x in a if ans[x] == 1])))) +import sys + +input = sys.stdin.readline +import math -if __name__ == "__main__": -    main() +def INT(): +    return int(eval(input())) + + +def MAPINT(): +    return list(map(int, input().split())) + + +def LMAPINT(): +    return list(map(int, input().split())) + + +def STR(): +    return eval(input()) + + +def MAPSTR(): +    return list(map(str, input().split())) + + +def LMAPSTR(): +    return list(map(str, input().split())) + + +f_inf = float("inf") +n = INT() +a = sorted(LMAPINT()) +length = max(a) + 1 +ans = [0] * length +for x in a: +    # 重複 +    if ans[x] != 0: +        ans[x] = 2 +        continue +    for j in range(x, length, x): +        ans[j] += 1 +count = 0 +for x in a: +    if ans[x] == 1: +        count += 1 +print(count)