#16D8101012J 伊藤惇 dj Python3
import math

def Prime_Numbers(x):
    i=2
    flag=True
    while i <= math.sqrt(x):
        if x%i==0:
            print("x={}".format(x))
            flag=False  
            break
        i+=1
    return flag
if __name__ == "__main__":
    A=[]
    n=int(input())
    for i in range(n):
        A.append(int(input()))
    sum=0
    for i in A:
        print("i={}".format(i))
        if Prime_Numbers(i):
            sum+=1
    print(sum)

