from sys import stdin
def isPrime(x):
    if x == 2: return 1
    elif x % 2 == 0: return 0
    return pow(2, x - 1, x) == 1
n = int(stdin.readline())
cnt = 0
for i in range(0, n):
    cnt += isPrime(int(stdin.readline()))
print(cnt) from sys import stdin def isPrime(x):
    if x == 2: return 1
    elif x % 2 == 0: return 0
    return pow(2, x - 1, x) == 1 isPrime if x == 2: return 1
    elif x % 2 == 0: return 0
     x == 2 x 2 elif x % 2 == 0: return 0
     x % 2 == 0 x % 2 x 2 0 return pow(2, x - 1, x) == 1 pow(2, x - 1, x) == 1 pow(2, x - 1, x) pow 2 x - 1 x 1 x 1 x x n = int(stdin.readline()) n int(stdin.readline()) int stdin.readline() stdin.readline stdin readline cnt = 0 cnt 0 for i in range(0, n):
    cnt += isPrime(int(stdin.readline())) i range(0, n) range 0 n cnt += isPrime(int(stdin.readline())) cnt isPrime(int(stdin.readline())) isPrime int(stdin.readline()) int stdin.readline() stdin.readline stdin readline print(cnt) print cnt def isPrime(x):
    if x == 2: return 1
    elif x % 2 == 0: return 0
    return pow(2, x - 1, x) == 1 def isPrime(x):
    if x == 2: return 1
    elif x % 2 == 0: return 0
    return pow(2, x - 1, x) == 1 isPrime n = int(stdin.readline()) int(stdin.readline()) n cnt += isPrime(int(stdin.readline())) isPrime(int(stdin.readline())) cnt cnt = 0 0 cnt
from sys import stdin
def isPrime(x):
    if x == 2: return 1
    elif x % 2 == 0: return 0
    return pow(2, x - 1, x) == 1
n = int(stdin.readline())
cnt = 0
for i in range(0, n):
    cnt += isPrime(int(stdin.readline()))
print(cnt)