import java.util.Scanner;

public class Main {

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

		int n = sc.nextInt();

		int count = 0;
    	for (int i = 0; i < n; i++) {
    		int data = sc.nextInt();
    		if (checkPrimeNum(data)) {
    			count++;
    		}
    	}

    	System.out.println(count);
    	
        sc.close();
	}

	private static boolean checkPrimeNum(int data) {
		if (data == 2) {
			return true;
		}
		if (data % 2 == 0) {
			return false;
		}
		for (int i = 3; i <= (int)Math.sqrt(data) + 1; i += 2) {
			if (data % i == 0) {
				return false;
			}
		}
//		System.out.println("prime: " + data);
		return true;
	}
} import java.util.Scanner; Scanner java.util public class Main {

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

		int n = sc.nextInt();

		int count = 0;
    	for (int i = 0; i < n; i++) {
    		int data = sc.nextInt();
    		if (checkPrimeNum(data)) {
    			count++;
    		}
    	}

    	System.out.println(count);
    	
        sc.close();
	}

	private static boolean checkPrimeNum(int data) {
		if (data == 2) {
			return true;
		}
		if (data % 2 == 0) {
			return false;
		}
		for (int i = 3; i <= (int)Math.sqrt(data) + 1; i += 2) {
			if (data % i == 0) {
				return false;
			}
		}
//		System.out.println("prime: " + data);
		return true;
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 

		int n = sc.nextInt();

		int count = 0;
    	for (int i = 0; i < n; i++) {
    		int data = sc.nextInt();
    		if (checkPrimeNum(data)) {
    			count++;
    		}
    	}

    	System.out.println(count);
    	
        sc.close();
	} main {
		Scanner sc = new Scanner(System.in); 

		int n = sc.nextInt();

		int count = 0;
    	for (int i = 0; i < n; i++) {
    		int data = sc.nextInt();
    		if (checkPrimeNum(data)) {
    			count++;
    		}
    	}

    	System.out.println(count);
    	
        sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int count = 0; count 0 for (int i = 0; i < n; i++) {
    		int data = sc.nextInt();
    		if (checkPrimeNum(data)) {
    			count++;
    		}
    	} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
    		int data = sc.nextInt();
    		if (checkPrimeNum(data)) {
    			count++;
    		}
    	} {
    		int data = sc.nextInt();
    		if (checkPrimeNum(data)) {
    			count++;
    		}
    	} int data = sc.nextInt(); data sc.nextInt() sc.nextInt sc if (checkPrimeNum(data)) {
    			count++;
    		} checkPrimeNum(data) checkPrimeNum data {
    			count++;
    		} count++ count System.out.println(count) System.out.println System.out System System.out count sc.close() sc.close sc String[] args args private static boolean checkPrimeNum(int data) {
		if (data == 2) {
			return true;
		}
		if (data % 2 == 0) {
			return false;
		}
		for (int i = 3; i <= (int)Math.sqrt(data) + 1; i += 2) {
			if (data % i == 0) {
				return false;
			}
		}
//		System.out.println("prime: " + data);
		return true;
	} checkPrimeNum {
		if (data == 2) {
			return true;
		}
		if (data % 2 == 0) {
			return false;
		}
		for (int i = 3; i <= (int)Math.sqrt(data) + 1; i += 2) {
			if (data % i == 0) {
				return false;
			}
		}
//		System.out.println("prime: " + data);
		return true;
	} if (data == 2) {
			return true;
		} data == 2 data 2 {
			return true;
		} return true; true if (data % 2 == 0) {
			return false;
		} data % 2 == 0 data % 2 data 2 0 {
			return false;
		} return false; false for (int i = 3; i <= (int)Math.sqrt(data) + 1; i += 2) {
			if (data % i == 0) {
				return false;
			}
		} int i = 3; int i = 3; i 3 i <= (int)Math.sqrt(data) + 1 i (int)Math.sqrt(data) + 1 (int)Math.sqrt(data) Math.sqrt Math data 1 i += 2 i += 2 i 2 {
			if (data % i == 0) {
				return false;
			}
		} {
			if (data % i == 0) {
				return false;
			}
		} if (data % i == 0) {
				return false;
			} data % i == 0 data % i data i 0 {
				return false;
			} return false; false return true; true int data data public class Main {

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

		int n = sc.nextInt();

		int count = 0;
    	for (int i = 0; i < n; i++) {
    		int data = sc.nextInt();
    		if (checkPrimeNum(data)) {
    			count++;
    		}
    	}

    	System.out.println(count);
    	
        sc.close();
	}

	private static boolean checkPrimeNum(int data) {
		if (data == 2) {
			return true;
		}
		if (data % 2 == 0) {
			return false;
		}
		for (int i = 3; i <= (int)Math.sqrt(data) + 1; i += 2) {
			if (data % i == 0) {
				return false;
			}
		}
//		System.out.println("prime: " + data);
		return true;
	}
} public class Main {

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

		int n = sc.nextInt();

		int count = 0;
    	for (int i = 0; i < n; i++) {
    		int data = sc.nextInt();
    		if (checkPrimeNum(data)) {
    			count++;
    		}
    	}

    	System.out.println(count);
    	
        sc.close();
	}

	private static boolean checkPrimeNum(int data) {
		if (data == 2) {
			return true;
		}
		if (data % 2 == 0) {
			return false;
		}
		for (int i = 3; i <= (int)Math.sqrt(data) + 1; i += 2) {
			if (data % i == 0) {
				return false;
			}
		}
//		System.out.println("prime: " + data);
		return true;
	}
} Main
import java.util.Scanner;

public class Main {

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

		int n = sc.nextInt();

		int count = 0;
    	for (int i = 0; i < n; i++) {
    		int data = sc.nextInt();
    		if (checkPrimeNum(data)) {
    			count++;
    		}
    	}

    	System.out.println(count);
    	
        sc.close();
	}

	private static boolean checkPrimeNum(int data) {
		if (data == 2) {
			return true;
		}
		if (data % 2 == 0) {
			return false;
		}
		for (int i = 3; i <= (int)Math.sqrt(data) + 1; i += 2) {
			if (data % i == 0) {
				return false;
			}
		}
//		System.out.println("prime: " + data);
		return true;
	}
}