import math
n = int(input())
A = [int(input()) for x in range(n)]
A_max = max(A)
for i in range(n):
    if A[i] < 2: A[i]=0
    for j in range(2,A[i]):
        if A[i] % j == 0:
            A[i] = 0
print(len([x for x in A if x != 0]))