import sys
import math
int(sys.stdin.readline())
list = list(map(int,sys.stdin.readline().split()))
max = max(list)
array= [True for _ in range(max+1)]
for i in range(2 , max+1):
j = 2
while(i*j < max+1):
array[i*j] = False
j+=1
answer = 0
for i in list:
if(i != 1):
answer += array[i]
print(answer)