object Main extends App{
    // Your code here!
    import scala.math.sqrt
    import scala.io.Source.stdin
    def is_prime(x: Int): Boolean = {
        x match {
            case 1 => return false
            case 2 | 3 => return true
            case _ => false
        }
        val last: Int = math.sqrt(x).toInt
        for(i <- 2 to last) {
            x%i match {
                case 0 => return false
                case _ => true
            }
        }
        true
    }
    def prime_num(nums: Int*): Int = {
        nums.filter(is_prime).length
    }
    val input = {for(line <- io.Source.stdin.getLines()) yield {
        line.toInt
    }}.toSeq
    val inputSeq = input.tail
    println(prime_num(inputSeq: _*))
}

