import math
import sys

def is_prime(x):
    if x==1: return 0
    if x==2: return 1
    n = 3
    while n <= math.sqrt(x):
        if x % n == 0:
            return 1
        n += 2
    return 1

count = 0
for line in sys.stdin:
    x = int(raw_input())
    count += is_prime(x)
print count
~
