import sys
from math import *
readline = sys.stdin.readline
def isPrime(x):
    if x == 2 or x == 3:
        return True
    elif x % 2 == 0 or x % 3 == 0:
        return False
    s = ceil(sqrt(x))
    for i in range(5, s + 1, 2):
        if x % i == 0:
            return False
    return True
print(sum(isPrime(int(readline())) for _ in range(int(input()))))
 import sys sys from math import * readline = sys.stdin.readline readline sys.stdin.readline sys.stdin sys stdin readline def isPrime(x):
    if x == 2 or x == 3:
        return True
    elif x % 2 == 0 or x % 3 == 0:
        return False
    s = ceil(sqrt(x))
    for i in range(5, s + 1, 2):
        if x % i == 0:
            return False
    return True isPrime if x == 2 or x == 3:
        return True
    elif x % 2 == 0 or x % 3 == 0:
        return False
     x == 2 or x == 3 x == 2 x 2 x == 3 x 3 return True True elif x % 2 == 0 or x % 3 == 0:
        return False
     x % 2 == 0 or x % 3 == 0 x % 2 == 0 x % 2 x 2 0 x % 3 == 0 x % 3 x 3 0 return False False s = ceil(sqrt(x)) s ceil(sqrt(x)) ceil sqrt(x) sqrt x for i in range(5, s + 1, 2):
        if x % i == 0:
            return False
     i range(5, s + 1, 2) range 5 s + 1 s 1 2 if x % i == 0:
            return False
     x % i == 0 x % i x i 0 return False False return True True x x print(sum(isPrime(int(readline())) for _ in range(int(input())))) print sum(isPrime(int(readline())) for _ in range(int(input()))) sum isPrime(int(readline())) isPrime int(readline()) int readline() readline readline = sys.stdin.readline sys.stdin.readline readline def isPrime(x):
    if x == 2 or x == 3:
        return True
    elif x % 2 == 0 or x % 3 == 0:
        return False
    s = ceil(sqrt(x))
    for i in range(5, s + 1, 2):
        if x % i == 0:
            return False
    return True def isPrime(x):
    if x == 2 or x == 3:
        return True
    elif x % 2 == 0 or x % 3 == 0:
        return False
    s = ceil(sqrt(x))
    for i in range(5, s + 1, 2):
        if x % i == 0:
            return False
    return True isPrime
import sys
from math import *
readline = sys.stdin.readline
def isPrime(x):
    if x == 2 or x == 3:
        return True
    elif x % 2 == 0 or x % 3 == 0:
        return False
    s = ceil(sqrt(x))
    for i in range(5, s + 1, 2):
        if x % i == 0:
            return False
    return True
print(sum(isPrime(int(readline())) for _ in range(int(input()))))

