from collections import defaultdict



def resolve():

	N = int(eval(input()))

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

	a_max = max(A)+1

	B = defaultdict(int)

	for i in range(N):

		a = A[i]

		if B[a]>1:

			B[a] = 2

		else:

			for j in range(a, a_max, a):

				B[j] += 1

	Y = 0

	for a in A:

		if B[a]==1:

			Y+=1

	print(Y)

resolve()
def resolve():

	N = int(eval(input()))

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

	a_max = max(A)+1

	B = {}

	for i in range(N):

		a = A[i]

		if a not in list(B.keys()):

			for j in range(a, a_max, a):

				B[j] = False

			B[a] = True

		else:

			B[a] = False

	Y = list(B.values()).count(True)

	print(Y)

resolve()
from collections import defaultdict


def resolve():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    a_max = max(A) + 1
    B = defaultdict(int)
    for i in range(N):
        a = A[i]
        if B[a] > 1:
            B[a] = 2
        else:
            for j in range(a, a_max, a):
                B[j] += 1
    Y = 0
    for a in A:
        if B[a] == 1:
            Y += 1
    print(Y)


resolve()

def resolve():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    a_max = max(A) + 1
    B = {}
    for i in range(N):
        a = A[i]
        if a not in list(B.keys()):
            for j in range(a, a_max, a):
                B[j] = False
            B[a] = True
        else:
            B[a] = False
    Y = list(B.values()).count(True)
    print(Y)


resolve()

-from collections import defaultdict - - -    B = defaultdict(int) +    B = {} -        if B[a] > 1: -            B[a] = 2 +        if a not in list(B.keys()): +            for j in range(a, a_max, a): +                B[j] = False +            B[a] = True -            for j in range(a, a_max, a): -                B[j] += 1 -    Y = 0 -    for a in A: -        if B[a] == 1: -            Y += 1 +            B[a] = False +    Y = list(B.values()).count(True)