import java.util.Scanner;
import java.math.*;

public class Main{
    Main(){
	Scanner sc = new Scanner(System.in);
	BigInteger bi;

	while(sc.hasNext()){
	    int cnt = 0;
	    for(int i = sc.nextInt(); i >= 1; --i){
		bi = new BigInteger(sc.next());
		if(bi.isProbablePrime(1000)) ++cnt;
	    }
	    System.out.printf("%d\n", cnt);
	}
    }

    public static void main(String[] args){
	new Main();
    }
} import java.util.Scanner; Scanner java.util import java.math.*; math.* java public class Main{
    Main(){
	Scanner sc = new Scanner(System.in);
	BigInteger bi;

	while(sc.hasNext()){
	    int cnt = 0;
	    for(int i = sc.nextInt(); i >= 1; --i){
		bi = new BigInteger(sc.next());
		if(bi.isProbablePrime(1000)) ++cnt;
	    }
	    System.out.printf("%d\n", cnt);
	}
    }

    public static void main(String[] args){
	new Main();
    }
} Main Main(){
	Scanner sc = new Scanner(System.in);
	BigInteger bi;

	while(sc.hasNext()){
	    int cnt = 0;
	    for(int i = sc.nextInt(); i >= 1; --i){
		bi = new BigInteger(sc.next());
		if(bi.isProbablePrime(1000)) ++cnt;
	    }
	    System.out.printf("%d\n", cnt);
	}
    } Main {
	Scanner sc = new Scanner(System.in);
	BigInteger bi;

	while(sc.hasNext()){
	    int cnt = 0;
	    for(int i = sc.nextInt(); i >= 1; --i){
		bi = new BigInteger(sc.next());
		if(bi.isProbablePrime(1000)) ++cnt;
	    }
	    System.out.printf("%d\n", cnt);
	}
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) BigInteger bi; bi while(sc.hasNext()){
	    int cnt = 0;
	    for(int i = sc.nextInt(); i >= 1; --i){
		bi = new BigInteger(sc.next());
		if(bi.isProbablePrime(1000)) ++cnt;
	    }
	    System.out.printf("%d\n", cnt);
	} sc.hasNext() sc.hasNext sc {
	    int cnt = 0;
	    for(int i = sc.nextInt(); i >= 1; --i){
		bi = new BigInteger(sc.next());
		if(bi.isProbablePrime(1000)) ++cnt;
	    }
	    System.out.printf("%d\n", cnt);
	} int cnt = 0; cnt 0 for(int i = sc.nextInt(); i >= 1; --i){
		bi = new BigInteger(sc.next());
		if(bi.isProbablePrime(1000)) ++cnt;
	    } int i = sc.nextInt(); int i = sc.nextInt(); i sc.nextInt() sc.nextInt sc i >= 1 i 1 --i --i i {
		bi = new BigInteger(sc.next());
		if(bi.isProbablePrime(1000)) ++cnt;
	    } {
		bi = new BigInteger(sc.next());
		if(bi.isProbablePrime(1000)) ++cnt;
	    } bi = new BigInteger(sc.next()) bi new BigInteger(sc.next()) if(bi.isProbablePrime(1000)) ++cnt; bi.isProbablePrime(1000) bi.isProbablePrime bi 1000 ++cnt cnt System.out.printf("%d\n", cnt) System.out.printf System.out System System.out "%d\n" cnt public static void main(String[] args){
	new Main();
    } main {
	new Main();
    } new Main() String[] args args public class Main{
    Main(){
	Scanner sc = new Scanner(System.in);
	BigInteger bi;

	while(sc.hasNext()){
	    int cnt = 0;
	    for(int i = sc.nextInt(); i >= 1; --i){
		bi = new BigInteger(sc.next());
		if(bi.isProbablePrime(1000)) ++cnt;
	    }
	    System.out.printf("%d\n", cnt);
	}
    }

    public static void main(String[] args){
	new Main();
    }
} public class Main{
    Main(){
	Scanner sc = new Scanner(System.in);
	BigInteger bi;

	while(sc.hasNext()){
	    int cnt = 0;
	    for(int i = sc.nextInt(); i >= 1; --i){
		bi = new BigInteger(sc.next());
		if(bi.isProbablePrime(1000)) ++cnt;
	    }
	    System.out.printf("%d\n", cnt);
	}
    }

    public static void main(String[] args){
	new Main();
    }
} Main
import java.util.Scanner;
import java.math.*;

public class Main{
    Main(){
	Scanner sc = new Scanner(System.in);
	BigInteger bi;

	while(sc.hasNext()){
	    int cnt = 0;
	    for(int i = sc.nextInt(); i >= 1; --i){
		bi = new BigInteger(sc.next());
		if(bi.isProbablePrime(1000)) ++cnt;
	    }
	    System.out.printf("%d\n", cnt);
	}
    }

    public static void main(String[] args){
	new Main();
    }
}