from math import sqrt
res = 0

def isprime(x) :
    if x == 2 : return 1
    if (x < 2) or (x % 2 == 0) : return 0

    i = 3
    while i <= sqrt(x) :
        if x % i == 0 : return 0
        i = i + 2

    return 1

for mak in range(int(input())) :
    res += isprime(int(input()))
print(res) from math import sqrt res = 0 res 0 def isprime(x) :
    if x == 2 : return 1
    if (x < 2) or (x % 2 == 0) : return 0

    i = 3
    while i <= sqrt(x) :
        if x % i == 0 : return 0
        i = i + 2

    return 1 isprime if x == 2 : return 1
     x == 2 x 2 if (x < 2) or (x % 2 == 0) : return 0

     (x < 2) or (x % 2 == 0) x < 2 x 2 x % 2 == 0 x % 2 x 2 0 i = 3 i 3 while i <= sqrt(x) :
        if x % i == 0 : return 0
        i = i + 2

     i <= sqrt(x) i sqrt(x) sqrt x if x % i == 0 : return 0
         x % i == 0 x % i x i 0 i = i + 2 i i + 2 i 2 return 1 1 x x for mak in range(int(input())) :
    res += isprime(int(input())) mak range(int(input())) range int(input()) int input() input res += isprime(int(input())) res isprime(int(input())) isprime int(input()) int input() input print(res) print res res = 0 0 res def isprime(x) :
    if x == 2 : return 1
    if (x < 2) or (x % 2 == 0) : return 0

    i = 3
    while i <= sqrt(x) :
        if x % i == 0 : return 0
        i = i + 2

    return 1 def isprime(x) :
    if x == 2 : return 1
    if (x < 2) or (x % 2 == 0) : return 0

    i = 3
    while i <= sqrt(x) :
        if x % i == 0 : return 0
        i = i + 2

    return 1 isprime res += isprime(int(input())) isprime(int(input())) res
from math import sqrt
res = 0

def isprime(x) :
    if x == 2 : return 1
    if (x < 2) or (x % 2 == 0) : return 0

    i = 3
    while i <= sqrt(x) :
        if x % i == 0 : return 0
        i = i + 2

    return 1

for mak in range(int(input())) :
    res += isprime(int(input()))
print(res)