import math

def is_prime(x):
    if x == 2:
        return True
    if x < 2 or x%2 == 0:
        return False
    i = 3
    while i < math.sqrt(x):
        if x%i == 0:
            return False
        i = i + 2
    return True

counter = 0
while 1:
    try:
        n = int(input())
        if is_prime(n):
            counter += 1
    except EOFError:
        break

print(counter)