def judge_prime(x):
    A = list(range(2,x+1))
    while A[-1]==x:
        if A[0]==x: return True
        A = list(filter(lambda y: y%A[0]!=0, A))
    return False

if __name__=='__main__':
    N=int(input())
    cnt=0
    for _ in range(N):
        if judge_prime(int(input())): cnt+=1
    print(cnt)