import math

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

n = int(input())
a = [int(input()) for _ in range(n)]
print(sum([1 if is_prime(i) else 0 for i in a]))

