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

def getPrimeNumFromList(list):
  count = 0
  for i in xrange(len(list)):
    target = 0
    if i == 0:
      target = list[0]
      if judgePrime(target):
        count += 1
    else:

  return count

n = int(raw_input())
list = []
for i in xrange(n):
  list.append(int(raw_input()))
list.sort()
print judgePrime(list[len(list) - 1])
# print getPrimeNumFromList(list)