import sys
input = sys.stdin.readline

def prime(x):
    if x==1: return False
    for i in range(2,int(x**0.5)+1):
        if x%i==0:
            return False
    return True

N=int(input())
ans=0
for i in range(N):
    if prime(int(input())):
        ans+=1
print(ans)
