import sys
import math


prime_numbers = [2, 3, 5, 7]

def prime_numbers_under(num):
  global prime_numbers

  prime_number_max = max(prime_numbers)
  if prime_number_max > num:
    return prime_numbers

  for i in range(prime_number_max + 1, num + 1):
    check_max = math.floor(math.sqrt(i))
    for j in prime_numbers:
      if j <= check_max:
        if i % j == 0:
          break
    else:
      prime_numbers.append(i)

  return prime_numbers

def main():
  amount = 0

  length = int(input())
  for _ in range(0, length):
    i = int(input())
    check_max = math.floor(math.sqrt(i))
    for j in prime_numbers_under(check_max):
      if j <= check_max:
        if i % j == 0:
          break
    else:
      amount += 1

  print(amount)
  return 0


if __name__ == '__main__':
  main() import sys sys import math math prime_numbers = [2, 3, 5, 7] prime_numbers [2, 3, 5, 7] 2 3 5 7 def prime_numbers_under(num):
  global prime_numbers

  prime_number_max = max(prime_numbers)
  if prime_number_max > num:
    return prime_numbers

  for i in range(prime_number_max + 1, num + 1):
    check_max = math.floor(math.sqrt(i))
    for j in prime_numbers:
      if j <= check_max:
        if i % j == 0:
          break
    else:
      prime_numbers.append(i)

  return prime_numbers prime_numbers_under global prime_numbers prime_number_max = max(prime_numbers) prime_number_max max(prime_numbers) max prime_numbers if prime_number_max > num:
    return prime_numbers

   prime_number_max > num prime_number_max num return prime_numbers prime_numbers for i in range(prime_number_max + 1, num + 1):
    check_max = math.floor(math.sqrt(i))
    for j in prime_numbers:
      if j <= check_max:
        if i % j == 0:
          break
    else:
      prime_numbers.append(i)

   i range(prime_number_max + 1, num + 1) range prime_number_max + 1 prime_number_max 1 num + 1 num 1 check_max = math.floor(math.sqrt(i)) check_max math.floor(math.sqrt(i)) math.floor math floor math.sqrt(i) math.sqrt math sqrt i for j in prime_numbers:
      if j <= check_max:
        if i % j == 0:
          break
    else:
      prime_numbers.append(i)

   j prime_numbers if j <= check_max:
        if i % j == 0:
          break
     j <= check_max j check_max if i % j == 0:
          break
     i % j == 0 i % j i j 0 break prime_numbers.append(i) prime_numbers.append prime_numbers append i return prime_numbers prime_numbers num num def main():
  amount = 0

  length = int(input())
  for _ in range(0, length):
    i = int(input())
    check_max = math.floor(math.sqrt(i))
    for j in prime_numbers_under(check_max):
      if j <= check_max:
        if i % j == 0:
          break
    else:
      amount += 1

  print(amount)
  return 0 main amount = 0 amount 0 length = int(input()) length int(input()) int input() input for _ in range(0, length):
    i = int(input())
    check_max = math.floor(math.sqrt(i))
    for j in prime_numbers_under(check_max):
      if j <= check_max:
        if i % j == 0:
          break
    else:
      amount += 1

   _ range(0, length) range 0 length i = int(input()) i int(input()) int input() input check_max = math.floor(math.sqrt(i)) check_max math.floor(math.sqrt(i)) math.floor math floor math.sqrt(i) math.sqrt math sqrt i for j in prime_numbers_under(check_max):
      if j <= check_max:
        if i % j == 0:
          break
    else:
      amount += 1

   j prime_numbers_under(check_max) prime_numbers_under check_max if j <= check_max:
        if i % j == 0:
          break
     j <= check_max j check_max if i % j == 0:
          break
     i % j == 0 i % j i j 0 break amount += 1 amount 1 print(amount) print amount return 0 0 if __name__ == '__main__':
  main() __name__ == '__main__' __name__ '__main__' main() main prime_numbers = [2, 3, 5, 7] [2, 3, 5, 7] prime_numbers def prime_numbers_under(num):
  global prime_numbers

  prime_number_max = max(prime_numbers)
  if prime_number_max > num:
    return prime_numbers

  for i in range(prime_number_max + 1, num + 1):
    check_max = math.floor(math.sqrt(i))
    for j in prime_numbers:
      if j <= check_max:
        if i % j == 0:
          break
    else:
      prime_numbers.append(i)

  return prime_numbers def prime_numbers_under(num):
  global prime_numbers

  prime_number_max = max(prime_numbers)
  if prime_number_max > num:
    return prime_numbers

  for i in range(prime_number_max + 1, num + 1):
    check_max = math.floor(math.sqrt(i))
    for j in prime_numbers:
      if j <= check_max:
        if i % j == 0:
          break
    else:
      prime_numbers.append(i)

  return prime_numbers prime_numbers_under def main():
  amount = 0

  length = int(input())
  for _ in range(0, length):
    i = int(input())
    check_max = math.floor(math.sqrt(i))
    for j in prime_numbers_under(check_max):
      if j <= check_max:
        if i % j == 0:
          break
    else:
      amount += 1

  print(amount)
  return 0 def main():
  amount = 0

  length = int(input())
  for _ in range(0, length):
    i = int(input())
    check_max = math.floor(math.sqrt(i))
    for j in prime_numbers_under(check_max):
      if j <= check_max:
        if i % j == 0:
          break
    else:
      amount += 1

  print(amount)
  return 0 main
import sys
import math


prime_numbers = [2, 3, 5, 7]

def prime_numbers_under(num):
  global prime_numbers

  prime_number_max = max(prime_numbers)
  if prime_number_max > num:
    return prime_numbers

  for i in range(prime_number_max + 1, num + 1):
    check_max = math.floor(math.sqrt(i))
    for j in prime_numbers:
      if j <= check_max:
        if i % j == 0:
          break
    else:
      prime_numbers.append(i)

  return prime_numbers

def main():
  amount = 0

  length = int(input())
  for _ in range(0, length):
    i = int(input())
    check_max = math.floor(math.sqrt(i))
    for j in prime_numbers_under(check_max):
      if j <= check_max:
        if i % j == 0:
          break
    else:
      amount += 1

  print(amount)
  return 0


if __name__ == '__main__':
  main()