from enum import Enum
import sys
import math

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001

def isprime(x):
    if x==2:
        return True
    if x < 2 or x%2==0:
        return False
    i=3
    while True:
        if i > math.sqrt(x):
            break
        if x % i ==0:
            return False
        i += 2
    return True

try_num=int(input())
num_prime=0
for i in range(try_num):
    test_num=int(input())
    if isprime(test_num):
        num_prime += 1

print("%d"%(num_prime))
 from enum import Enum import sys sys import math math BIG_NUM = 2000000000 BIG_NUM 2000000000 MOD = 1000000007 MOD 1000000007 EPS = 0.000000001 EPS 0.000000001 def isprime(x):
    if x==2:
        return True
    if x < 2 or x%2==0:
        return False
    i=3
    while True:
        if i > math.sqrt(x):
            break
        if x % i ==0:
            return False
        i += 2
    return True isprime if x==2:
        return True
     x==2 x 2 return True True if x < 2 or x%2==0:
        return False
     x < 2 or x%2==0 x < 2 x 2 x%2==0 x%2 x 2 0 return False False i=3 i 3 while True:
        if i > math.sqrt(x):
            break
        if x % i ==0:
            return False
        i += 2
     True if i > math.sqrt(x):
            break
         i > math.sqrt(x) i math.sqrt(x) math.sqrt math sqrt x break if x % i ==0:
            return False
         x % i ==0 x % i x i 0 return False False i += 2 i 2 return True True x x try_num=int(input()) try_num int(input()) int input() input num_prime=0 num_prime 0 for i in range(try_num):
    test_num=int(input())
    if isprime(test_num):
        num_prime += 1 i range(try_num) range try_num test_num=int(input()) test_num int(input()) int input() input if isprime(test_num):
        num_prime += 1 isprime(test_num) isprime test_num num_prime += 1 num_prime 1 print("%d"%(num_prime)) print "%d"%(num_prime) "%d" num_prime try_num=int(input()) int(input()) try_num test_num=int(input()) int(input()) test_num BIG_NUM = 2000000000 2000000000 BIG_NUM num_prime += 1 1 num_prime MOD = 1000000007 1000000007 MOD num_prime=0 0 num_prime def isprime(x):
    if x==2:
        return True
    if x < 2 or x%2==0:
        return False
    i=3
    while True:
        if i > math.sqrt(x):
            break
        if x % i ==0:
            return False
        i += 2
    return True def isprime(x):
    if x==2:
        return True
    if x < 2 or x%2==0:
        return False
    i=3
    while True:
        if i > math.sqrt(x):
            break
        if x % i ==0:
            return False
        i += 2
    return True isprime EPS = 0.000000001 0.000000001 EPS
from enum import Enum
import sys
import math

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001

def isprime(x):
    if x==2:
        return True
    if x < 2 or x%2==0:
        return False
    i=3
    while True:
        if i > math.sqrt(x):
            break
        if x % i ==0:
            return False
        i += 2
    return True

try_num=int(input())
num_prime=0
for i in range(try_num):
    test_num=int(input())
    if isprime(test_num):
        num_prime += 1

print("%d"%(num_prime))

