n = int(raw_input())

def isprime(m):
	if m == 2:
		return 1
	elif m < 2 or m % 2 == 0:
		return 0
	else:
		p = 3
		while p <= m**0.5:
			if m % p == 0:
				return 0
			p = p + 2
		return 1

cnt = 0
for i in range(n):
	cnt += isprime(int(raw_input()))
	#print("*{:}".format(cnt))

#print("")
print cnt n = int(raw_input()) n int(raw_input()) int raw_input() raw_input def isprime(m):
	if m == 2:
		return 1
	elif m < 2 or m % 2 == 0:
		return 0
	else:
		p = 3
		while p <= m**0.5:
			if m % p == 0:
				return 0
			p = p + 2
		return 1 isprime if m == 2:
		return 1
	elif m < 2 or m % 2 == 0:
		return 0
	else:
		p = 3
		while p <= m**0.5:
			if m % p == 0:
				return 0
			p = p + 2
		return 1 m == 2 m 2 return 1 1 elif m < 2 or m % 2 == 0:
		return 0
	 m < 2 or m % 2 == 0 m < 2 m 2 m % 2 == 0 m % 2 m 2 0 return 0 0 p = 3 p 3 while p <= m**0.5:
			if m % p == 0:
				return 0
			p = p + 2
		 p <= m**0.5 p m**0.5 m 0.5 if m % p == 0:
				return 0
			 m % p == 0 m % p m p 0 return 0 0 p = p + 2 p p + 2 p 2 return 1 1 m m cnt = 0 cnt 0 for i in range(n):
	cnt += isprime(int(raw_input()))
	#print("*{:}".format(cnt))

#print("") i range(n) range n cnt += isprime(int(raw_input())) cnt isprime(int(raw_input())) isprime int(raw_input()) int raw_input() raw_input print n = int(raw_input()) int(raw_input()) n cnt = 0 0 cnt def isprime(m):
	if m == 2:
		return 1
	elif m < 2 or m % 2 == 0:
		return 0
	else:
		p = 3
		while p <= m**0.5:
			if m % p == 0:
				return 0
			p = p + 2
		return 1 def isprime(m):
	if m == 2:
		return 1
	elif m < 2 or m % 2 == 0:
		return 0
	else:
		p = 3
		while p <= m**0.5:
			if m % p == 0:
				return 0
			p = p + 2
		return 1 isprime cnt += isprime(int(raw_input())) isprime(int(raw_input())) cnt
n = int(raw_input())

def isprime(m):
	if m == 2:
		return 1
	elif m < 2 or m % 2 == 0:
		return 0
	else:
		p = 3
		while p <= m**0.5:
			if m % p == 0:
				return 0
			p = p + 2
		return 1

cnt = 0
for i in range(n):
	cnt += isprime(int(raw_input()))
	#print("*{:}".format(cnt))

#print("")
print cnt