package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	n, err := nextInt(sc)
	if err != nil {
		panic(err)
	}
	var count = 0
	for i := 0; i < n; i++ {
		x, err := nextInt(sc)
		if err != nil {
			panic(err)
		}
		if isPrime(x) {
			count++
		}
	}
	fmt.Println(count)
}

func isPrime(x int) bool {
	if x == 1 {
		return false
	} else if x%2 == 0 {
		return false
	} else {
		y := int(math.Sqrt(float64(x)))
		for i := 3; i <= y; i++ {
			if x%i == 0 {
				return false
			}
		}
		return true
	}
}

func nextInt(sc *bufio.Scanner) (int, error) {
	sc.Scan()
	v, err := strconv.Atoi(sc.Text())
	return v, err
}

