import sys

def checkprime(a):
    for t in range (a-2):
        s=t+2
        if a%s==0:
            return 0
    return 1
    

count =0

for line in sys.stdin:
    a=int(line.strip())
    count =count + checkprime(a)

print count