def isprime(x):
    if x==2:
        return True
    if x<2 or x%2==0:
        return False
    i=3
    while i*i<=x:
        if x%i==0:
            return False
    return True

while True:
    try:
        n = int(input())
    except:
        break
    ans=0
    for i in range(n):
        num=int(input())
        if isprime(num):
            ans+=1
    print(ans)
