import pdb

n = int(raw_input())
count = 0
for x in xrange(n):
  target = int(raw_input())
  # pdb.set_trace()
  if target == 2:
    count += 1
  elif target < 3 or not target & 1:
    continue
  else:
    if pow(2, target - 1, target) == 1:
      count += 1

print count import pdb pdb n = int(raw_input()) n int(raw_input()) int raw_input() raw_input count = 0 count 0 for x in xrange(n):
  target = int(raw_input())
  # pdb.set_trace()
  if target == 2:
    count += 1
  elif target < 3 or not target & 1:
    continue
  else:
    if pow(2, target - 1, target) == 1:
      count += 1 x xrange(n) xrange n target = int(raw_input()) target int(raw_input()) int raw_input() raw_input if target == 2:
    count += 1
  elif target < 3 or not target & 1:
    continue
  else:
    if pow(2, target - 1, target) == 1:
      count += 1 target == 2 target 2 count += 1 count 1 elif target < 3 or not target & 1:
    continue
   target < 3 or not target & 1 target < 3 target 3 not target & 1 target & 1 target 1 continue if pow(2, target - 1, target) == 1:
      count += 1 pow(2, target - 1, target) == 1 pow(2, target - 1, target) pow 2 target - 1 target 1 target 1 count += 1 count 1 print target = int(raw_input()) int(raw_input()) target n = int(raw_input()) int(raw_input()) n count += 1 1 count count = 0 0 count count += 1 1 count
import pdb

n = int(raw_input())
count = 0
for x in xrange(n):
  target = int(raw_input())
  # pdb.set_trace()
  if target == 2:
    count += 1
  elif target < 3 or not target & 1:
    continue
  else:
    if pow(2, target - 1, target) == 1:
      count += 1

print count