package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func isPrime(x int) bool {
	return x == 2 || (int)(math.Pow(2, (float64)(x-1)))%x == 1
}

func main() {
	//sc.Split(bufio.ScanWords)
	n := nextInt()
	cnt := 0
	for i := 0; i < n; i++ {
		if isPrime(nextInt()) {
			cnt++
		}
	}
	fmt.Println(cnt)
}

