#16D8101012J 伊藤惇 dj Python3
import math
def check(B,i):
    sum=0 
    for j in range(len(B)):
        if B[j]%10 in [1,2,4,5,6,8]:
            del B[j]
            check(B,i)
        if B[j]%i==0:
            sum+=1
            del B[j]
    return sum
def Prime_Numbers(A):
    mx=max(A)
    sum=0
    if 2 in A:
        sum+=1
    if 3 in A:
        sum+=1
    if 5 in A:
        sum+=1
    if 7 in A:
        sum+=1
    i=10
    while i <= math.sqrt(mx):
        mx=max[A]
        sum+=check(A,i)
        i+=1
    print("A={}".format(A))
    return sum

if __name__ == "__main__":
    A=[]
    n=int(input())
    for i in range(n):
        A.append(int(input()))
    print(Prime_Numbers(A))
