max_num = 100000000
is_primer = [True for _ in range(max_num+1)]
for i in range(2,int(len(is_primer)/2)):
	if is_primer[i]:
		for j in range(i*2,len(is_primer),i):
			is_primer[j] = False
num = set()
try:
	while True:
		num.add(eval(input()))
except EOFError:
	count = 0
	for x in num:
		count = count + (1 if is_primer[x] else 0)
	print(count)