def judgePrime(n):
  result = True
  for i in xrange(2, n):
    if n % i == 0:
      result = False
      break
  return result

n = int(raw_input())
count = 0

for i in xrange(n):
  if judgePrime(int(raw_input())):
    count += 1

print count