# coding: utf-8
from math import sqrt

def isPrime(n):
	if n == 2:
		return True
	elif n < 2 or n % 2 == 0:
		return False
	else:
		i = 3
		while i <= sqrt(n):
			if n % i == 0:
				return False
			i += 2
		return True

def main():
	n = input()
	print sum([1 if isPrime(x) else 0 for x in [input() for _ in xrange(n)]])

if __name__ == '__main__':
	main() from math import sqrt def isPrime(n):
	if n == 2:
		return True
	elif n < 2 or n % 2 == 0:
		return False
	else:
		i = 3
		while i <= sqrt(n):
			if n % i == 0:
				return False
			i += 2
		return True isPrime if n == 2:
		return True
	elif n < 2 or n % 2 == 0:
		return False
	else:
		i = 3
		while i <= sqrt(n):
			if n % i == 0:
				return False
			i += 2
		return True n == 2 n 2 return True True elif n < 2 or n % 2 == 0:
		return False
	 n < 2 or n % 2 == 0 n < 2 n 2 n % 2 == 0 n % 2 n 2 0 return False False i = 3 i 3 while i <= sqrt(n):
			if n % i == 0:
				return False
			i += 2
		 i <= sqrt(n) i sqrt(n) sqrt n if n % i == 0:
				return False
			 n % i == 0 n % i n i 0 return False False i += 2 i 2 return True True n n def main():
	n = input()
	print sum([1 if isPrime(x) else 0 for x in [input() for _ in xrange(n)]]) main n = input() n input() input print 1 if isPrime(x) else 0 for x in [input() for _ in xrange(n)] for x in [input() for _ in xrange(n)] x [input() for _ in xrange(n)] for x in [input() for _ in xrange(n)] 1 if isPrime(x) else 0 isPrime(x) isPrime x 1 0 sum([1 if isPrime(x) else 0 for x in [input() for _ in xrange(n)]]) sum [1 if isPrime(x) else 0 for x in [input() for _ in xrange(n)]] if __name__ == '__main__':
	main() __name__ == '__main__' __name__ '__main__' main() main def main():
	n = input()
	print sum([1 if isPrime(x) else 0 for x in [input() for _ in xrange(n)]]) def main():
	n = input()
	print sum([1 if isPrime(x) else 0 for x in [input() for _ in xrange(n)]]) main def isPrime(n):
	if n == 2:
		return True
	elif n < 2 or n % 2 == 0:
		return False
	else:
		i = 3
		while i <= sqrt(n):
			if n % i == 0:
				return False
			i += 2
		return True def isPrime(n):
	if n == 2:
		return True
	elif n < 2 or n % 2 == 0:
		return False
	else:
		i = 3
		while i <= sqrt(n):
			if n % i == 0:
				return False
			i += 2
		return True isPrime
# coding: utf-8
from math import sqrt

def isPrime(n):
	if n == 2:
		return True
	elif n < 2 or n % 2 == 0:
		return False
	else:
		i = 3
		while i <= sqrt(n):
			if n % i == 0:
				return False
			i += 2
		return True

def main():
	n = input()
	print sum([1 if isPrime(x) else 0 for x in [input() for _ in xrange(n)]])

if __name__ == '__main__':
	main()