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

cnt = n
for i in ( 0 ... nums.length )
	if 2 == nums[i]
		next
	end
	if 0 == nums[i]%2
		cnt-=1
		next
	end
	3.step( Math.sqrt(nums[i]), 2 ) { |j|
		if 0 == nums[i]%j
			cnt-=1
			break
		end
	}
end

puts( cnt )