A prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. For example, the first four prime numbers are: 2, 3, 5 and 7.  Write a program which reads a list of _N_ integers and prints the number of prime numbers in the list.
cnt_num = int(input())
dataset = [int(input()) for i in range(cnt_num)]

for i in dataset:
    if i <= 1:
        continue
    if i == 2:
        print(i)
        continue
    if i % 2 == 0:
        continue

    ok = ''
    for j in range(3,i,2):
        if i % j == 0:
           break
        else:
           ok = 'X'
           break

    if ok == 'X':
        print(i)
        continue
def check_prime(num):
    if num == 2:
        return True

    if num < 2 or num % 2 == 0:
        return False

    return pow(2,num-1,num) == 1

cnt_num = int(input())
dataset = [int(input()) for i in range(cnt_num)]

count = 0
for i in dataset:
    if check_prime(i):
        count += 1

print(count)