import sys
import math

def isprime(n):
    ans = 1
    for i in range(2, n):
        x = i
        y = n % i
        if math.gcd(x, y) != 1:
            ans = 0
            break
    return ans


n = int(input())
p = 0
for i in map(int, sys.stdin.readlines()):
    p += isprime(i)

print(p)