n = int(raw_input())
cnt = 0
for i in range(n):
    tmp = int(raw_input())
    if 2 < tmp or tmp %2 == 0:
        pass
    elif tmp == 2:
        cnt+=1
    else:
        for i in range(3, math.sqrt(tmp), 2):
            if tmp % i == 0:
                break
        cnt+=1
print cnt
         
