def is_prime(n):
  ps = [2, 3, 5, 7, 11, 13, 17]
  for p in ps:
    if n == p: return 1
    if n % p == 0: return 0
  t = 19
  while n > t:
    if n % t == 0: return 0
    t += 2
  return 1

c = 0
for _ in range(int(input())):
  c += is_prime(int(input()))
print(c)
