def getprimes(n):
  primes = []
  for i in xrange(2, n+1):
    isprime = True
    for j in xrange(len(primes)):
      if i % primes[j] == 0:
        isprime = False
        break
    if isprime:
      primes.append(i)
  return primes

n = int(raw_input())
primes = getprimes(10000)
count = 0
for _ in xrange(n):
  x = int(raw_input())
  isprime = True
  for i in xrange(len(primes)):
    if primes[i] >= x:
      break
    if x % primes[i] == 0:
      isprime = False
      break
  if isprime:
    count += 1
print count def getprimes(n):
  primes = []
  for i in xrange(2, n+1):
    isprime = True
    for j in xrange(len(primes)):
      if i % primes[j] == 0:
        isprime = False
        break
    if isprime:
      primes.append(i)
  return primes getprimes primes = [] primes [] for i in xrange(2, n+1):
    isprime = True
    for j in xrange(len(primes)):
      if i % primes[j] == 0:
        isprime = False
        break
    if isprime:
      primes.append(i)
   i xrange(2, n+1) xrange 2 n+1 n 1 isprime = True isprime True for j in xrange(len(primes)):
      if i % primes[j] == 0:
        isprime = False
        break
     j xrange(len(primes)) xrange len(primes) len primes if i % primes[j] == 0:
        isprime = False
        break
     i % primes[j] == 0 i % primes[j] i primes[j] primes j 0 isprime = False isprime False break if isprime:
      primes.append(i)
   isprime primes.append(i) primes.append primes append i return primes primes n n n = int(raw_input()) n int(raw_input()) int raw_input() raw_input primes = getprimes(10000) primes getprimes(10000) getprimes 10000 count = 0 count 0 for _ in xrange(n):
  x = int(raw_input())
  isprime = True
  for i in xrange(len(primes)):
    if primes[i] >= x:
      break
    if x % primes[i] == 0:
      isprime = False
      break
  if isprime:
    count += 1 _ xrange(n) xrange n x = int(raw_input()) x int(raw_input()) int raw_input() raw_input isprime = True isprime True for i in xrange(len(primes)):
    if primes[i] >= x:
      break
    if x % primes[i] == 0:
      isprime = False
      break
   i xrange(len(primes)) xrange len(primes) len primes if primes[i] >= x:
      break
     primes[i] >= x primes[i] primes i x break if x % primes[i] == 0:
      isprime = False
      break
   x % primes[i] == 0 x % primes[i] x primes[i] primes i 0 isprime = False isprime False break if isprime:
    count += 1 isprime count += 1 count 1 print n = int(raw_input()) int(raw_input()) n isprime = True True isprime count += 1 1 count x = int(raw_input()) int(raw_input()) x isprime = False False isprime count = 0 0 count def getprimes(n):
  primes = []
  for i in xrange(2, n+1):
    isprime = True
    for j in xrange(len(primes)):
      if i % primes[j] == 0:
        isprime = False
        break
    if isprime:
      primes.append(i)
  return primes def getprimes(n):
  primes = []
  for i in xrange(2, n+1):
    isprime = True
    for j in xrange(len(primes)):
      if i % primes[j] == 0:
        isprime = False
        break
    if isprime:
      primes.append(i)
  return primes getprimes primes = getprimes(10000) getprimes(10000) primes
def getprimes(n):
  primes = []
  for i in xrange(2, n+1):
    isprime = True
    for j in xrange(len(primes)):
      if i % primes[j] == 0:
        isprime = False
        break
    if isprime:
      primes.append(i)
  return primes

n = int(raw_input())
primes = getprimes(10000)
count = 0
for _ in xrange(n):
  x = int(raw_input())
  isprime = True
  for i in xrange(len(primes)):
    if primes[i] >= x:
      break
    if x % primes[i] == 0:
      isprime = False
      break
  if isprime:
    count += 1
print count