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
nums = []
n.times {
	nums.push( gets.to_i )
}

cnt = 0
for i in ( 0 ... n )
	if isPrime( nums[i] )
		cnt += 1
	end
	i += 1
end
puts( cnt )