import sys



input_methods=['clipboard','file','key']

using_method=0

input_method=input_methods[using_method]



tin=lambda : list(map(int, input().split()))

lin=lambda : list(tin())

mod=1000000007



#+++++



def main():

	n = int(eval(input()))

	#b , c = tin()

	#s = input()

	al=lin()

	vm=10**6+1

	rr = [0]*(vm)

	for v in al:

		rr[v]+=1

	

	for v in list(set(al)):

		for i in range(2*v, vm, v):

			rr[i]=0

	ret = rr.count(1)

	print(ret)

	

#+++++

isTest=False



def pa(v):

	if isTest:

		print(v)

		

def input_clipboard():

	import clipboard

	input_text=clipboard.get()

	input_l=input_text.splitlines()

	for l in input_l:

		yield l



if __name__ == "__main__":

	if sys.platform =='ios':

		if input_method==input_methods[0]:

			ic=input_clipboard()

			input = lambda : ic.__next__()

		elif input_method==input_methods[1]:

			sys.stdin=open('inputFile.txt')

		else:

			pass

		isTest=True

	else:

		pass

		#input = sys.stdin.readline

			

	ret = main()

	if ret is not None:

		print(ret)
import sys



input_methods=['clipboard','file','key']

using_method=0

input_method=input_methods[using_method]



tin=lambda : list(map(int, input().split()))

lin=lambda : list(tin())

mod=1000000007



#+++++



def main():

	n = int(eval(input()))

	#b , c = tin()

	#s = input()

	al=lin()

	vm=10**6+1

	rr = [0]*(vm)

	for v in al:

		rr[v]+=1

	ual=list(set(al))

	ual.sort()

	for v in ual:

		if rr[v]==0:

			continue

		for i in range(2*v, vm, v):

			rr[i]=0

	ret = rr.count(1)

	print(ret)

	

#+++++

isTest=False



def pa(v):

	if isTest:

		print(v)

		

def input_clipboard():

	import clipboard

	input_text=clipboard.get()

	input_l=input_text.splitlines()

	for l in input_l:

		yield l



if __name__ == "__main__":

	if sys.platform =='ios':

		if input_method==input_methods[0]:

			ic=input_clipboard()

			input = lambda : ic.__next__()

		elif input_method==input_methods[1]:

			sys.stdin=open('inputFile.txt')

		else:

			pass

		isTest=True

	else:

		pass

		#input = sys.stdin.readline

			

	ret = main()

	if ret is not None:

		print(ret)
import sys

input_methods = ["clipboard", "file", "key"]
using_method = 0
input_method = input_methods[using_method]
tin = lambda: list(map(int, input().split()))
lin = lambda: list(tin())
mod = 1000000007
# +++++
def main():
    n = int(eval(input()))
    # b , c = tin()
    # s = input()
    al = lin()
    vm = 10**6 + 1
    rr = [0] * (vm)
    for v in al:
        rr[v] += 1
    for v in list(set(al)):
        for i in range(2 * v, vm, v):
            rr[i] = 0
    ret = rr.count(1)
    print(ret)


# +++++
isTest = False


def pa(v):
    if isTest:
        print(v)


def input_clipboard():
    import clipboard

    input_text = clipboard.get()
    input_l = input_text.splitlines()
    for l in input_l:
        yield l


if __name__ == "__main__":
    if sys.platform == "ios":
        if input_method == input_methods[0]:
            ic = input_clipboard()
            input = lambda: ic.__next__()
        elif input_method == input_methods[1]:
            sys.stdin = open("inputFile.txt")
        else:
            pass
        isTest = True
    else:
        pass
        # input = sys.stdin.readline
    ret = main()
    if ret is not None:
        print(ret)

import sys

input_methods = ["clipboard", "file", "key"]
using_method = 0
input_method = input_methods[using_method]
tin = lambda: list(map(int, input().split()))
lin = lambda: list(tin())
mod = 1000000007
# +++++
def main():
    n = int(eval(input()))
    # b , c = tin()
    # s = input()
    al = lin()
    vm = 10**6 + 1
    rr = [0] * (vm)
    for v in al:
        rr[v] += 1
    ual = list(set(al))
    ual.sort()
    for v in ual:
        if rr[v] == 0:
            continue
        for i in range(2 * v, vm, v):
            rr[i] = 0
    ret = rr.count(1)
    print(ret)


# +++++
isTest = False


def pa(v):
    if isTest:
        print(v)


def input_clipboard():
    import clipboard

    input_text = clipboard.get()
    input_l = input_text.splitlines()
    for l in input_l:
        yield l


if __name__ == "__main__":
    if sys.platform == "ios":
        if input_method == input_methods[0]:
            ic = input_clipboard()
            input = lambda: ic.__next__()
        elif input_method == input_methods[1]:
            sys.stdin = open("inputFile.txt")
        else:
            pass
        isTest = True
    else:
        pass
        # input = sys.stdin.readline
    ret = main()
    if ret is not None:
        print(ret)

-    for v in list(set(al)): +    ual = list(set(al)) +    ual.sort() +    for v in ual: +        if rr[v] == 0: +            continue