#coding: UTF-8

import sys
import math

class Algo:
  @staticmethod
  def is_prime(n):
    if n == 2:
      return True
    elif n<2 or n%2 == 0:
      return False
    else:
      for i in range(3,int(math.sqrt(n))+2, 2):
        if n%i == 0:
          return False
    return True

N = int(input())
ans = 0
for i in range(0,N):
  if Algo.is_prime(int(input())):
    ans += 1
print(ans) import sys sys import math math class Algo:
  @staticmethod
  def is_prime(n):
    if n == 2:
      return True
    elif n<2 or n%2 == 0:
      return False
    else:
      for i in range(3,int(math.sqrt(n))+2, 2):
        if n%i == 0:
          return False
    return True Algo def is_prime(n):
    if n == 2:
      return True
    elif n<2 or n%2 == 0:
      return False
    else:
      for i in range(3,int(math.sqrt(n))+2, 2):
        if n%i == 0:
          return False
    return True is_prime if n == 2:
      return True
    elif n<2 or n%2 == 0:
      return False
    else:
      for i in range(3,int(math.sqrt(n))+2, 2):
        if n%i == 0:
          return False
     n == 2 n 2 return True True elif n<2 or n%2 == 0:
      return False
     n<2 or n%2 == 0 n<2 n 2 n%2 == 0 n%2 n 2 0 return False False for i in range(3,int(math.sqrt(n))+2, 2):
        if n%i == 0:
          return False
     i range(3,int(math.sqrt(n))+2, 2) range 3 int(math.sqrt(n))+2 int(math.sqrt(n)) int math.sqrt(n) math.sqrt math sqrt n 2 2 if n%i == 0:
          return False
     n%i == 0 n%i n i 0 return False False return True True n n @staticmethod
   is_prime staticmethod is_prime N = int(input()) N int(input()) int input() input ans = 0 ans 0 for i in range(0,N):
  if Algo.is_prime(int(input())):
    ans += 1 i range(0,N) range 0 N if Algo.is_prime(int(input())):
    ans += 1 Algo.is_prime(int(input())) Algo.is_prime Algo is_prime int(input()) int input() input ans += 1 ans 1 print(ans) print ans ans += 1 1 ans ans = 0 0 ans N = int(input()) int(input()) N class Algo:
  @staticmethod
  def is_prime(n):
    if n == 2:
      return True
    elif n<2 or n%2 == 0:
      return False
    else:
      for i in range(3,int(math.sqrt(n))+2, 2):
        if n%i == 0:
          return False
    return True class Algo:
  @staticmethod
  def is_prime(n):
    if n == 2:
      return True
    elif n<2 or n%2 == 0:
      return False
    else:
      for i in range(3,int(math.sqrt(n))+2, 2):
        if n%i == 0:
          return False
    return True Algo
#coding: UTF-8

import sys
import math

class Algo:
  @staticmethod
  def is_prime(n):
    if n == 2:
      return True
    elif n<2 or n%2 == 0:
      return False
    else:
      for i in range(3,int(math.sqrt(n))+2, 2):
        if n%i == 0:
          return False
    return True

N = int(input())
ans = 0
for i in range(0,N):
  if Algo.is_prime(int(input())):
    ans += 1
print(ans)