require 'prime'

primes = []
Prime.each( 10000 ) { |i|
	primes.push( i )
}

n = gets.to_i
nums = []
n.times {
	nums.push( gets.to_i )
}
cnt = n
nums.each { |val|
	primes.each { |i|
		break if val == i
		
		if 0 == val%i
			cnt-=1
			break;
		end
	}
}

puts( cnt )