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

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

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