import java.util.Scanner;
import java.lang.Math;

// ALDS1_1_C
public class Main {
	boolean primeJudge(int a) {
		double sqrt = Math.sqrt(a) + 1;
		if (a < 2) return false;
		if (a == 2) return true;
		if (a % 2 == 0) return false;
		for (int i = 3; i < sqrt; i+=2) {
			if (a % i == 0) return false;
		}
		return true;
	}
	
	void run() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count = 0;
		for (int i = 0; i < n; i++) {
			if (primeJudge(sc.nextInt())) count++;
		}
		System.out.println(count);
	}

	public static void main(String[] args) {
		new Main().run();
	}
} import java.util.Scanner; Scanner java.util import java.lang.Math; Math java.lang public class Main {
	boolean primeJudge(int a) {
		double sqrt = Math.sqrt(a) + 1;
		if (a < 2) return false;
		if (a == 2) return true;
		if (a % 2 == 0) return false;
		for (int i = 3; i < sqrt; i+=2) {
			if (a % i == 0) return false;
		}
		return true;
	}
	
	void run() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count = 0;
		for (int i = 0; i < n; i++) {
			if (primeJudge(sc.nextInt())) count++;
		}
		System.out.println(count);
	}

	public static void main(String[] args) {
		new Main().run();
	}
} Main boolean primeJudge(int a) {
		double sqrt = Math.sqrt(a) + 1;
		if (a < 2) return false;
		if (a == 2) return true;
		if (a % 2 == 0) return false;
		for (int i = 3; i < sqrt; i+=2) {
			if (a % i == 0) return false;
		}
		return true;
	} primeJudge {
		double sqrt = Math.sqrt(a) + 1;
		if (a < 2) return false;
		if (a == 2) return true;
		if (a % 2 == 0) return false;
		for (int i = 3; i < sqrt; i+=2) {
			if (a % i == 0) return false;
		}
		return true;
	} double sqrt = Math.sqrt(a) + 1; sqrt Math.sqrt(a) + 1 Math.sqrt(a) Math.sqrt Math a 1 if (a < 2) return false; a < 2 a 2 return false; false if (a == 2) return true; a == 2 a 2 return true; true if (a % 2 == 0) return false; a % 2 == 0 a % 2 a 2 0 return false; false for (int i = 3; i < sqrt; i+=2) {
			if (a % i == 0) return false;
		} int i = 3; int i = 3; i 3 i < sqrt i sqrt i+=2 i+=2 i 2 {
			if (a % i == 0) return false;
		} {
			if (a % i == 0) return false;
		} if (a % i == 0) return false; a % i == 0 a % i a i 0 return false; false return true; true int a a void run() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count = 0;
		for (int i = 0; i < n; i++) {
			if (primeJudge(sc.nextInt())) count++;
		}
		System.out.println(count);
	} run {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count = 0;
		for (int i = 0; i < n; i++) {
			if (primeJudge(sc.nextInt())) count++;
		}
		System.out.println(count);
	} 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++) {
			if (primeJudge(sc.nextInt())) count++;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			if (primeJudge(sc.nextInt())) count++;
		} {
			if (primeJudge(sc.nextInt())) count++;
		} if (primeJudge(sc.nextInt())) count++; primeJudge(sc.nextInt()) primeJudge sc.nextInt() sc.nextInt sc count++ count System.out.println(count) System.out.println System.out System System.out count public static void main(String[] args) {
		new Main().run();
	} main {
		new Main().run();
	} new Main().run() new Main().run new Main() String[] args args public class Main {
	boolean primeJudge(int a) {
		double sqrt = Math.sqrt(a) + 1;
		if (a < 2) return false;
		if (a == 2) return true;
		if (a % 2 == 0) return false;
		for (int i = 3; i < sqrt; i+=2) {
			if (a % i == 0) return false;
		}
		return true;
	}
	
	void run() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count = 0;
		for (int i = 0; i < n; i++) {
			if (primeJudge(sc.nextInt())) count++;
		}
		System.out.println(count);
	}

	public static void main(String[] args) {
		new Main().run();
	}
} public class Main {
	boolean primeJudge(int a) {
		double sqrt = Math.sqrt(a) + 1;
		if (a < 2) return false;
		if (a == 2) return true;
		if (a % 2 == 0) return false;
		for (int i = 3; i < sqrt; i+=2) {
			if (a % i == 0) return false;
		}
		return true;
	}
	
	void run() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count = 0;
		for (int i = 0; i < n; i++) {
			if (primeJudge(sc.nextInt())) count++;
		}
		System.out.println(count);
	}

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

// ALDS1_1_C
public class Main {
	boolean primeJudge(int a) {
		double sqrt = Math.sqrt(a) + 1;
		if (a < 2) return false;
		if (a == 2) return true;
		if (a % 2 == 0) return false;
		for (int i = 3; i < sqrt; i+=2) {
			if (a % i == 0) return false;
		}
		return true;
	}
	
	void run() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count = 0;
		for (int i = 0; i < n; i++) {
			if (primeJudge(sc.nextInt())) count++;
		}
		System.out.println(count);
	}

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