def judgePrime(n):
  result = True
  for i in xrange(2, int(round(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:
        pass

  return count

n = int(raw_input())
list = []

for i in xrange(n):
  list.append(int(raw_input()))
list.sort()

prime_list = []
all_list = range(2, list[len(list) - 1] + 1)

while True:
  v = all_list.pop(0)
  prime_list.append(v)
  # print "all_list : "
  # print all_list
  # print "prime_list : "
  # print prime_list
  for i in xrange(len(all_list)):
    if i >= len(all_list):
      break
    elif all_list[i] % v == 0:
      all_list.pop(i)
      i -= 1
  if len(all_list) == 0:
    break
  elif prime_list[len(prime_list) - 1] ^ 2 >= all_list[len(all_list) - 1]:
    prime_list.append(all_list)
    break

count = 0
for i in xrange(len(prime_list)):
  if prime_list[i] in list:
    count += 1

print count