# coding: utf-8

def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1
    
ans = 0
n = int(input())
for i in range(n):
    if is_prime(int(input())):
        ans += 1
    
print(ans) def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1
     is_prime q = abs(q) q abs(q) abs q if q == 2: return True
     q == 2 q 2 if q < 2 or q&1 == 0: return False
     q < 2 or q&1 == 0 q < 2 q 2 q&1 == 0 q&1 q 1 0 return pow(2, q-1, q) == 1 pow(2, q-1, q) == 1 pow(2, q-1, q) pow 2 q-1 q 1 q 1 q q ans = 0 ans 0 n = int(input()) n int(input()) int input() input for i in range(n):
    if is_prime(int(input())):
        ans += 1
     i range(n) range n if is_prime(int(input())):
        ans += 1
     is_prime(int(input())) is_prime int(input()) int input() input ans += 1 ans 1 print(ans) print ans def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1
     def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1
     is_prime n = int(input()) int(input()) n ans = 0 0 ans ans += 1 1 ans
# coding: utf-8

def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1
    
ans = 0
n = int(input())
for i in range(n):
    if is_prime(int(input())):
        ans += 1
    
print(ans)