import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int num[] = new int[n];
		
		for (int i = 0; i < n; i++) {
			num[i]  = scan.nextInt();
		}

		int count = 0;
		
		for (int i = 0; i < n; i++) {
			if (num[i] % 2 == 0 && num[i] > 2) continue;
			boolean isPrime = true;
			for (int j = 3; j * j <= num[i]; j += 2) {
				if (num[i] % j == 0) {
					isPrime = false;
					break;
				}
			}
			if (isPrime) count++;
		}
		
		System.out.println(count);
		scan.close();
	}

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

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int num[] = new int[n];
		
		for (int i = 0; i < n; i++) {
			num[i]  = scan.nextInt();
		}

		int count = 0;
		
		for (int i = 0; i < n; i++) {
			if (num[i] % 2 == 0 && num[i] > 2) continue;
			boolean isPrime = true;
			for (int j = 3; j * j <= num[i]; j += 2) {
				if (num[i] % j == 0) {
					isPrime = false;
					break;
				}
			}
			if (isPrime) count++;
		}
		
		System.out.println(count);
		scan.close();
	}

} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int num[] = new int[n];
		
		for (int i = 0; i < n; i++) {
			num[i]  = scan.nextInt();
		}

		int count = 0;
		
		for (int i = 0; i < n; i++) {
			if (num[i] % 2 == 0 && num[i] > 2) continue;
			boolean isPrime = true;
			for (int j = 3; j * j <= num[i]; j += 2) {
				if (num[i] % j == 0) {
					isPrime = false;
					break;
				}
			}
			if (isPrime) count++;
		}
		
		System.out.println(count);
		scan.close();
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int num[] = new int[n];
		
		for (int i = 0; i < n; i++) {
			num[i]  = scan.nextInt();
		}

		int count = 0;
		
		for (int i = 0; i < n; i++) {
			if (num[i] % 2 == 0 && num[i] > 2) continue;
			boolean isPrime = true;
			for (int j = 3; j * j <= num[i]; j += 2) {
				if (num[i] % j == 0) {
					isPrime = false;
					break;
				}
			}
			if (isPrime) count++;
		}
		
		System.out.println(count);
		scan.close();
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int num[] = new int[n]; num new int[n] n for (int i = 0; i < n; i++) {
			num[i]  = scan.nextInt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			num[i]  = scan.nextInt();
		} {
			num[i]  = scan.nextInt();
		} num[i]  = scan.nextInt() num[i] num i scan.nextInt() scan.nextInt scan int count = 0; count 0 for (int i = 0; i < n; i++) {
			if (num[i] % 2 == 0 && num[i] > 2) continue;
			boolean isPrime = true;
			for (int j = 3; j * j <= num[i]; j += 2) {
				if (num[i] % j == 0) {
					isPrime = false;
					break;
				}
			}
			if (isPrime) count++;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			if (num[i] % 2 == 0 && num[i] > 2) continue;
			boolean isPrime = true;
			for (int j = 3; j * j <= num[i]; j += 2) {
				if (num[i] % j == 0) {
					isPrime = false;
					break;
				}
			}
			if (isPrime) count++;
		} {
			if (num[i] % 2 == 0 && num[i] > 2) continue;
			boolean isPrime = true;
			for (int j = 3; j * j <= num[i]; j += 2) {
				if (num[i] % j == 0) {
					isPrime = false;
					break;
				}
			}
			if (isPrime) count++;
		} if (num[i] % 2 == 0 && num[i] > 2) continue; num[i] % 2 == 0 && num[i] > 2 num[i] % 2 == 0 num[i] % 2 num[i] num i 2 0 num[i] > 2 num[i] num i 2 continue; boolean isPrime = true; isPrime true for (int j = 3; j * j <= num[i]; j += 2) {
				if (num[i] % j == 0) {
					isPrime = false;
					break;
				}
			} int j = 3; int j = 3; j 3 j * j <= num[i] j * j j j num[i] num i j += 2 j += 2 j 2 {
				if (num[i] % j == 0) {
					isPrime = false;
					break;
				}
			} {
				if (num[i] % j == 0) {
					isPrime = false;
					break;
				}
			} if (num[i] % j == 0) {
					isPrime = false;
					break;
				} num[i] % j == 0 num[i] % j num[i] num i j 0 {
					isPrime = false;
					break;
				} isPrime = false isPrime false break; if (isPrime) count++; isPrime count++ count System.out.println(count) System.out.println System.out System System.out count scan.close() scan.close scan String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int num[] = new int[n];
		
		for (int i = 0; i < n; i++) {
			num[i]  = scan.nextInt();
		}

		int count = 0;
		
		for (int i = 0; i < n; i++) {
			if (num[i] % 2 == 0 && num[i] > 2) continue;
			boolean isPrime = true;
			for (int j = 3; j * j <= num[i]; j += 2) {
				if (num[i] % j == 0) {
					isPrime = false;
					break;
				}
			}
			if (isPrime) count++;
		}
		
		System.out.println(count);
		scan.close();
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int num[] = new int[n];
		
		for (int i = 0; i < n; i++) {
			num[i]  = scan.nextInt();
		}

		int count = 0;
		
		for (int i = 0; i < n; i++) {
			if (num[i] % 2 == 0 && num[i] > 2) continue;
			boolean isPrime = true;
			for (int j = 3; j * j <= num[i]; j += 2) {
				if (num[i] % j == 0) {
					isPrime = false;
					break;
				}
			}
			if (isPrime) count++;
		}
		
		System.out.println(count);
		scan.close();
	}

} Main
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int num[] = new int[n];
		
		for (int i = 0; i < n; i++) {
			num[i]  = scan.nextInt();
		}

		int count = 0;
		
		for (int i = 0; i < n; i++) {
			if (num[i] % 2 == 0 && num[i] > 2) continue;
			boolean isPrime = true;
			for (int j = 3; j * j <= num[i]; j += 2) {
				if (num[i] % j == 0) {
					isPrime = false;
					break;
				}
			}
			if (isPrime) count++;
		}
		
		System.out.println(count);
		scan.close();
	}

}