object Main extends App {
  val sc = new java.util.Scanner (Console.in)

  def nextInt() = Integer.parseInt(sc.next)

  def factors(n: Int): List[Int] = {
    def loop(n:Int, f:Int, a:List[Int]): List[Int] = {
      if (n == 1)
        a
      else {
        if (n % f == 0)
          loop(n / f, f, f::a)
        else
          loop(n, f + 1, a)
      }
    }
    loop(n, 2, List()).reverse
  }

  val xs = List.fill(nextInt)(nextInt)
  println(xs.count(factors(_).tail == Nil))
}

