import java.util.Scanner;


public class Main{

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int cnt = Integer.parseInt(s.nextLine());
		int result = 0;
		for(int i=0 ; i<cnt ; i++) {
			int number = Integer.parseInt(s.nextLine());
			result += solve(number);
		}
		System.out.println(result);
	}

	public static int solve(int number) {
		if(number == 2) {
			return 1;
		}
		if(number % 2 == 0) {
			return 0;
		}
		for(int i=3 ; i<=Math.sqrt(number) ; i+=2){
			if(number % i == 0) {
				return 0;
			}
		}
		return 1;
	}

} import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int cnt = Integer.parseInt(s.nextLine());
		int result = 0;
		for(int i=0 ; i<cnt ; i++) {
			int number = Integer.parseInt(s.nextLine());
			result += solve(number);
		}
		System.out.println(result);
	}

	public static int solve(int number) {
		if(number == 2) {
			return 1;
		}
		if(number % 2 == 0) {
			return 0;
		}
		for(int i=3 ; i<=Math.sqrt(number) ; i+=2){
			if(number % i == 0) {
				return 0;
			}
		}
		return 1;
	}

} Main public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int cnt = Integer.parseInt(s.nextLine());
		int result = 0;
		for(int i=0 ; i<cnt ; i++) {
			int number = Integer.parseInt(s.nextLine());
			result += solve(number);
		}
		System.out.println(result);
	} main {
		Scanner s = new Scanner(System.in);
		int cnt = Integer.parseInt(s.nextLine());
		int result = 0;
		for(int i=0 ; i<cnt ; i++) {
			int number = Integer.parseInt(s.nextLine());
			result += solve(number);
		}
		System.out.println(result);
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int cnt = Integer.parseInt(s.nextLine()); cnt Integer.parseInt(s.nextLine()) Integer.parseInt Integer s.nextLine() s.nextLine s int result = 0; result 0 for(int i=0 ; i<cnt ; i++) {
			int number = Integer.parseInt(s.nextLine());
			result += solve(number);
		} int i=0 ; int i=0 ; i 0 i<cnt i cnt i++ i++ i {
			int number = Integer.parseInt(s.nextLine());
			result += solve(number);
		} {
			int number = Integer.parseInt(s.nextLine());
			result += solve(number);
		} int number = Integer.parseInt(s.nextLine()); number Integer.parseInt(s.nextLine()) Integer.parseInt Integer s.nextLine() s.nextLine s result += solve(number) result solve(number) solve number System.out.println(result) System.out.println System.out System System.out result String[] args args public static int solve(int number) {
		if(number == 2) {
			return 1;
		}
		if(number % 2 == 0) {
			return 0;
		}
		for(int i=3 ; i<=Math.sqrt(number) ; i+=2){
			if(number % i == 0) {
				return 0;
			}
		}
		return 1;
	} solve {
		if(number == 2) {
			return 1;
		}
		if(number % 2 == 0) {
			return 0;
		}
		for(int i=3 ; i<=Math.sqrt(number) ; i+=2){
			if(number % i == 0) {
				return 0;
			}
		}
		return 1;
	} if(number == 2) {
			return 1;
		} number == 2 number 2 {
			return 1;
		} return 1; 1 if(number % 2 == 0) {
			return 0;
		} number % 2 == 0 number % 2 number 2 0 {
			return 0;
		} return 0; 0 for(int i=3 ; i<=Math.sqrt(number) ; i+=2){
			if(number % i == 0) {
				return 0;
			}
		} int i=3 ; int i=3 ; i 3 i<=Math.sqrt(number) i Math.sqrt(number) Math.sqrt Math number i+=2 i+=2 i 2 {
			if(number % i == 0) {
				return 0;
			}
		} {
			if(number % i == 0) {
				return 0;
			}
		} if(number % i == 0) {
				return 0;
			} number % i == 0 number % i number i 0 {
				return 0;
			} return 0; 0 return 1; 1 int number number public class Main{

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int cnt = Integer.parseInt(s.nextLine());
		int result = 0;
		for(int i=0 ; i<cnt ; i++) {
			int number = Integer.parseInt(s.nextLine());
			result += solve(number);
		}
		System.out.println(result);
	}

	public static int solve(int number) {
		if(number == 2) {
			return 1;
		}
		if(number % 2 == 0) {
			return 0;
		}
		for(int i=3 ; i<=Math.sqrt(number) ; i+=2){
			if(number % i == 0) {
				return 0;
			}
		}
		return 1;
	}

} public class Main{

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int cnt = Integer.parseInt(s.nextLine());
		int result = 0;
		for(int i=0 ; i<cnt ; i++) {
			int number = Integer.parseInt(s.nextLine());
			result += solve(number);
		}
		System.out.println(result);
	}

	public static int solve(int number) {
		if(number == 2) {
			return 1;
		}
		if(number % 2 == 0) {
			return 0;
		}
		for(int i=3 ; i<=Math.sqrt(number) ; i+=2){
			if(number % i == 0) {
				return 0;
			}
		}
		return 1;
	}

} Main
import java.util.Scanner;


public class Main{

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int cnt = Integer.parseInt(s.nextLine());
		int result = 0;
		for(int i=0 ; i<cnt ; i++) {
			int number = Integer.parseInt(s.nextLine());
			result += solve(number);
		}
		System.out.println(result);
	}

	public static int solve(int number) {
		if(number == 2) {
			return 1;
		}
		if(number % 2 == 0) {
			return 0;
		}
		for(int i=3 ; i<=Math.sqrt(number) ; i+=2){
			if(number % i == 0) {
				return 0;
			}
		}
		return 1;
	}

}