def isPrime( x ):
	if 2 == x or 3 == x:
		return True
	if 0 == x&1:
		return False
	i = 3 
	while  i*i <= x:
		if 0 == x%i:
			return False
		i += 1
	return True


n = int( raw_input( ) )
nums = []
while 0 < n:
	nums.append( int( raw_input( ) ) )
	n -= 1
cnt = 0
for num in nums:
	if isPrime( num  ):
		cnt += 1

print( cnt ) def isPrime( x ):
	if 2 == x or 3 == x:
		return True
	if 0 == x&1:
		return False
	i = 3 
	while  i*i <= x:
		if 0 == x%i:
			return False
		i += 1
	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 while  i*i <= x:
		if 0 == x%i:
			return False
		i += 1
	 i*i <= x i*i i i x if 0 == x%i:
			return False
		 0 == x%i 0 x%i x i return False False i += 1 i 1 return True True x x n = int( raw_input( ) ) n int( raw_input( ) ) int raw_input( ) raw_input nums = [] nums [] while 0 < n:
	nums.append( int( raw_input( ) ) )
	n -= 1 0 < n 0 n nums.append( int( raw_input( ) ) ) nums.append nums append int( raw_input( ) ) int raw_input( ) raw_input n -= 1 n 1 cnt = 0 cnt 0 for num in nums:
	if isPrime( num  ):
		cnt += 1 num nums if isPrime( num  ):
		cnt += 1 isPrime( num  ) isPrime num cnt += 1 cnt 1 print( cnt ) print cnt cnt += 1 1 cnt n = int( raw_input( ) ) int( raw_input( ) ) n n -= 1 1 n cnt = 0 0 cnt nums = [] [] nums def isPrime( x ):
	if 2 == x or 3 == x:
		return True
	if 0 == x&1:
		return False
	i = 3 
	while  i*i <= x:
		if 0 == x%i:
			return False
		i += 1
	return True def isPrime( x ):
	if 2 == x or 3 == x:
		return True
	if 0 == x&1:
		return False
	i = 3 
	while  i*i <= x:
		if 0 == x%i:
			return False
		i += 1
	return True isPrime
def isPrime( x ):
	if 2 == x or 3 == x:
		return True
	if 0 == x&1:
		return False
	i = 3 
	while  i*i <= x:
		if 0 == x%i:
			return False
		i += 1
	return True


n = int( raw_input( ) )
nums = []
while 0 < n:
	nums.append( int( raw_input( ) ) )
	n -= 1
cnt = 0
for num in nums:
	if isPrime( num  ):
		cnt += 1

print( cnt )