n = gets.to_i
cnt = n
n.times {
    val = gets.to_i

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

puts( cnt )