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 a = sc.nextInt();
			if(isPrime(a)) {
				count++;
			}
		}
		System.out.println(count);
	}

	static boolean isPrime(int a) {
		if(a == 2) {
			return(true);
		} else if(a < 2 || a % 2 ==0) {
			return(false);
		} else {
			for(int i = 3; i <= Math.sqrt(a); i++) {
				if(a % i == 0) {
					return(false);
				}
			}
			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 a = sc.nextInt();
			if(isPrime(a)) {
				count++;
			}
		}
		System.out.println(count);
	}

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

	static boolean isPrime(int a) {
		if(a == 2) {
			return(true);
		} else if(a < 2 || a % 2 ==0) {
			return(false);
		} else {
			for(int i = 3; i <= Math.sqrt(a); i++) {
				if(a % i == 0) {
					return(false);
				}
			}
			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 a = sc.nextInt();
			if(isPrime(a)) {
				count++;
			}
		}
		System.out.println(count);
	}

	static boolean isPrime(int a) {
		if(a == 2) {
			return(true);
		} else if(a < 2 || a % 2 ==0) {
			return(false);
		} else {
			for(int i = 3; i <= Math.sqrt(a); i++) {
				if(a % i == 0) {
					return(false);
				}
			}
			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 a = sc.nextInt();
			if(isPrime(a)) {
				count++;
			}
		}
		System.out.println(count);
	}

	static boolean isPrime(int a) {
		if(a == 2) {
			return(true);
		} else if(a < 2 || a % 2 ==0) {
			return(false);
		} else {
			for(int i = 3; i <= Math.sqrt(a); i++) {
				if(a % i == 0) {
					return(false);
				}
			}
			return(true);
		}
	}
}

