import math

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

        
        

p = 0
n = int(input())

for i in range(n):
    if prime(int(input())) == True:
        p += 1
        

print(p) import math math def prime(x):
    if x == 2:
        return True
    elif x%2 == 0:
        return False
    else:
        i = 3
        while i <= math.sqrt(x):
           if x%i == 0:
                return False
           else:
                i += 2
        return True

        
         prime if x == 2:
        return True
    elif x%2 == 0:
        return False
    else:
        i = 3
        while i <= math.sqrt(x):
           if x%i == 0:
                return False
           else:
                i += 2
        return True

        
         x == 2 x 2 return True True elif x%2 == 0:
        return False
     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
           else:
                i += 2
         i <= math.sqrt(x) i math.sqrt(x) math.sqrt math sqrt x if x%i == 0:
                return False
           else:
                i += 2
         x%i == 0 x%i x i 0 return False False i += 2 i 2 return True True x x p = 0 p 0 n = int(input()) n int(input()) int input() input for i in range(n):
    if prime(int(input())) == True:
        p += 1
         i range(n) range n if prime(int(input())) == True:
        p += 1
         prime(int(input())) == True prime(int(input())) prime int(input()) int input() input True p += 1 p 1 print(p) print p p += 1 1 p n = int(input()) int(input()) n def prime(x):
    if x == 2:
        return True
    elif x%2 == 0:
        return False
    else:
        i = 3
        while i <= math.sqrt(x):
           if x%i == 0:
                return False
           else:
                i += 2
        return True

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

        
         prime p = 0 0 p
import math

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

        
        

p = 0
n = int(input())

for i in range(n):
    if prime(int(input())) == True:
        p += 1
        

print(p)