from math import sqrt

def is_prime(n):
  if n == 2:
    return True
  for i in range(2, int(sqrt(n)+1)):
    if n % i == 0:
      return False
  return True

N = int(input())
res = 0
for i in range(N):
  if is_prime(int(input())):
    res += 1

print(res)

