
n_input = int(input())

main_count = 0

for i in range(n_input):
  n = int(input())
  dev = 2
  sub_count = 0
  while dev <= n:
    if n % dev == 0:
      sub_count += 1
    dev += 1
  if sub_count == 1:
     main_count += 1

print(main_count)