import math

def isPrime( x ):
	if 2 == x or 3 == x:
		return True
	if 0 == x&1:
		return False
	i = 3
	limit = math.sqrt( x )
	while  i <= limit:
		if 0 == x%i:
			return False
		i += 2
	return True
 
 
n = int( raw_input( ) )
nums = []
i = 0
while i < n:
    nums.append( int( raw_input( ) ) )
    i += 1
cnt = i = 0
for val in nums:
    if isPrime( val ):
        cnt += 1
 
print( cnt ) import math math def isPrime( x ):
	if 2 == x or 3 == x:
		return True
	if 0 == x&1:
		return False
	i = 3
	limit = math.sqrt( x )
	while  i <= limit:
		if 0 == x%i:
			return False
		i += 2
	return True
 
  isPrime if 2 == x or 3 == x:
		return True
	 2 == x or 3 == x 2 == x 2 x 3 == x 3 x return True True if 0 == x&1:
		return False
	 0 == x&1 0 x&1 x 1 return False False i = 3 i 3 limit = math.sqrt( x ) limit math.sqrt( x ) math.sqrt math sqrt x while  i <= limit:
		if 0 == x%i:
			return False
		i += 2
	 i <= limit i limit if 0 == x%i:
			return False
		 0 == x%i 0 x%i x i return False False i += 2 i 2 return True True x x n = int( raw_input( ) ) n int( raw_input( ) ) int raw_input( ) raw_input nums = [] nums [] i = 0 i 0 while i < n:
    nums.append( int( raw_input( ) ) )
    i += 1 i < n i n nums.append( int( raw_input( ) ) ) nums.append nums append int( raw_input( ) ) int raw_input( ) raw_input i += 1 i 1 cnt = i = 0 cnt 0 = i = 0 i 0 for val in nums:
    if isPrime( val ):
        cnt += 1
  val nums if isPrime( val ):
        cnt += 1
  isPrime( val ) isPrime val cnt += 1 cnt 1 print( cnt ) print cnt cnt = i = 0 0 cnt def isPrime( x ):
	if 2 == x or 3 == x:
		return True
	if 0 == x&1:
		return False
	i = 3
	limit = math.sqrt( x )
	while  i <= limit:
		if 0 == x%i:
			return False
		i += 2
	return True
 
  def isPrime( x ):
	if 2 == x or 3 == x:
		return True
	if 0 == x&1:
		return False
	i = 3
	limit = math.sqrt( x )
	while  i <= limit:
		if 0 == x%i:
			return False
		i += 2
	return True
 
  isPrime cnt += 1 1 cnt i += 1 1 i n = int( raw_input( ) ) int( raw_input( ) ) n i = 0 0 i nums = [] [] nums i = 0 0 i
import math

def isPrime( x ):
	if 2 == x or 3 == x:
		return True
	if 0 == x&1:
		return False
	i = 3
	limit = math.sqrt( x )
	while  i <= limit:
		if 0 == x%i:
			return False
		i += 2
	return True
 
 
n = int( raw_input( ) )
nums = []
i = 0
while i < n:
    nums.append( int( raw_input( ) ) )
    i += 1
cnt = i = 0
for val in nums:
    if isPrime( val ):
        cnt += 1
 
print( cnt )