import math
def prime(v):
  if v == 2: return 1
  if v > 2 and v % 2 == 0: return 0

  for i in range(int(math.sqrt(v)), 2, -1):
    if v % i == 0: return 0
  return 1

N = int(raw_input())
n = []
count = 0
for i in range(N):
  count += prime(int(raw_input()))
print count
