n = gets.to_i
nums = []
n.times {
    nums.push( gets.to_i )
}

cnt = n
nums.each { |val|
	if 2 == val
		next
	end
	if 0 == val%2
		cnt-=1
		next
	end
	3.step( Math.sqrt(val), 2 ) { |j|
		if 0 == val%j
			cnt-=1
			break
		end
	}
}

puts( cnt )