#ALDS 1-C: Prime Numbers
import math

n = int(input())
c = 0
for i in range(n):
    x = int(input())
    f = 1
    for j in range(2,int(math.sqrt(x))+1):
        if x % j == 0: 
            f = 0
            break
    c = c + f
print(c)

