def isPrime( x )
	return true if ( 2 == x || 3 == x )
	return false if ( 0 == x%2 )
	
	for i in ( 3 .. x )
		break if x < i*i
		return false if 0 == x%i
	end
	
	return true
end

n = gets.to_i
cnt = 0
n.times {
	num = gets.to_i
	if isPrime( num )
		cnt += 1
	end	
}
puts( cnt )