import math

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

        return True

num = raw_input()

count = 0
for i in range(int(num)):
        x = raw_input()
        if isprime(int(x)):
                count += 1

print count import math math def isprime(x):
        if x == 2:
                return True
        if x < 2 or x % 2 == 0:
                return False
        i = 3
        while(i <= math.sqrt(x)):
                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(i <= math.sqrt(x)):
                if x % i == 0:
                        return False
                i += 2

         i <= math.sqrt(x) i math.sqrt(x) math.sqrt math sqrt x 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 num = raw_input() num raw_input() raw_input count = 0 count 0 for i in range(int(num)):
        x = raw_input()
        if isprime(int(x)):
                count += 1 i range(int(num)) range int(num) int num x = raw_input() x raw_input() raw_input if isprime(int(x)):
                count += 1 isprime(int(x)) isprime int(x) int x count += 1 count 1 print count += 1 1 count def isprime(x):
        if x == 2:
                return True
        if x < 2 or x % 2 == 0:
                return False
        i = 3
        while(i <= math.sqrt(x)):
                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(i <= math.sqrt(x)):
                if x % i == 0:
                        return False
                i += 2

        return True isprime x = raw_input() raw_input() x count = 0 0 count num = raw_input() raw_input() num
import math

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

        return True

num = raw_input()

count = 0
for i in range(int(num)):
        x = raw_input()
        if isprime(int(x)):
                count += 1

print count