import java.util.Scanner;

public class Main {
	public static void main (String [] args) {
		Scanner scan = new Scanner (System.in);
		int n = scan.nextInt();
		boolean flg;
		int count = 0;
		
		for (int i = 0; i < n; i++) {
			int x = scan.nextInt();
			flg = isprime(x);
			if ( flg == true) count++;
		}
		
		scan.close();
		System.out.println(count);
	}
	
	public static boolean isprime(int x) {
		
		if (x == 2) return true;
		
		if (x < 2 || x % 2 == 0) return false;
		
		int i = 3;
		
		while ( i <= Math.sqrt((double)x)) {
			if (x % i == 0) return false;
			
			i += 2;
		}
		
		return true;
	}
}
 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();
		boolean flg;
		int count = 0;
		
		for (int i = 0; i < n; i++) {
			int x = scan.nextInt();
			flg = isprime(x);
			if ( flg == true) count++;
		}
		
		scan.close();
		System.out.println(count);
	}
	
	public static boolean isprime(int x) {
		
		if (x == 2) return true;
		
		if (x < 2 || x % 2 == 0) return false;
		
		int i = 3;
		
		while ( i <= Math.sqrt((double)x)) {
			if (x % i == 0) return false;
			
			i += 2;
		}
		
		return true;
	}
} Main public static void main (String [] args) {
		Scanner scan = new Scanner (System.in);
		int n = scan.nextInt();
		boolean flg;
		int count = 0;
		
		for (int i = 0; i < n; i++) {
			int x = scan.nextInt();
			flg = isprime(x);
			if ( flg == true) count++;
		}
		
		scan.close();
		System.out.println(count);
	} main {
		Scanner scan = new Scanner (System.in);
		int n = scan.nextInt();
		boolean flg;
		int count = 0;
		
		for (int i = 0; i < n; i++) {
			int x = scan.nextInt();
			flg = isprime(x);
			if ( flg == true) count++;
		}
		
		scan.close();
		System.out.println(count);
	} Scanner scan = new Scanner (System.in); scan new Scanner (System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan boolean flg; flg int count = 0; count 0 for (int i = 0; i < n; i++) {
			int x = scan.nextInt();
			flg = isprime(x);
			if ( flg == true) count++;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int x = scan.nextInt();
			flg = isprime(x);
			if ( flg == true) count++;
		} {
			int x = scan.nextInt();
			flg = isprime(x);
			if ( flg == true) count++;
		} int x = scan.nextInt(); x scan.nextInt() scan.nextInt scan flg = isprime(x) flg isprime(x) isprime x if ( flg == true) count++; flg == true flg true count++ count scan.close() scan.close scan System.out.println(count) System.out.println System.out System System.out count String [] args args public static boolean isprime(int x) {
		
		if (x == 2) return true;
		
		if (x < 2 || x % 2 == 0) return false;
		
		int i = 3;
		
		while ( i <= Math.sqrt((double)x)) {
			if (x % i == 0) return false;
			
			i += 2;
		}
		
		return true;
	} isprime {
		
		if (x == 2) return true;
		
		if (x < 2 || x % 2 == 0) return false;
		
		int i = 3;
		
		while ( i <= Math.sqrt((double)x)) {
			if (x % i == 0) return false;
			
			i += 2;
		}
		
		return true;
	} if (x == 2) return true; x == 2 x 2 return true; true if (x < 2 || x % 2 == 0) return false; x < 2 || x % 2 == 0 x < 2 x 2 x % 2 == 0 x % 2 x 2 0 return false; false int i = 3; i 3 while ( i <= Math.sqrt((double)x)) {
			if (x % i == 0) return false;
			
			i += 2;
		} i <= Math.sqrt((double)x) i Math.sqrt((double)x) Math.sqrt Math (double)x {
			if (x % i == 0) return false;
			
			i += 2;
		} if (x % i == 0) return false; x % i == 0 x % i x i 0 return false; false i += 2 i 2 return true; true int x x public class Main {
	public static void main (String [] args) {
		Scanner scan = new Scanner (System.in);
		int n = scan.nextInt();
		boolean flg;
		int count = 0;
		
		for (int i = 0; i < n; i++) {
			int x = scan.nextInt();
			flg = isprime(x);
			if ( flg == true) count++;
		}
		
		scan.close();
		System.out.println(count);
	}
	
	public static boolean isprime(int x) {
		
		if (x == 2) return true;
		
		if (x < 2 || x % 2 == 0) return false;
		
		int i = 3;
		
		while ( i <= Math.sqrt((double)x)) {
			if (x % i == 0) return false;
			
			i += 2;
		}
		
		return true;
	}
} public class Main {
	public static void main (String [] args) {
		Scanner scan = new Scanner (System.in);
		int n = scan.nextInt();
		boolean flg;
		int count = 0;
		
		for (int i = 0; i < n; i++) {
			int x = scan.nextInt();
			flg = isprime(x);
			if ( flg == true) count++;
		}
		
		scan.close();
		System.out.println(count);
	}
	
	public static boolean isprime(int x) {
		
		if (x == 2) return true;
		
		if (x < 2 || x % 2 == 0) return false;
		
		int i = 3;
		
		while ( i <= Math.sqrt((double)x)) {
			if (x % i == 0) return false;
			
			i += 2;
		}
		
		return true;
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main (String [] args) {
		Scanner scan = new Scanner (System.in);
		int n = scan.nextInt();
		boolean flg;
		int count = 0;
		
		for (int i = 0; i < n; i++) {
			int x = scan.nextInt();
			flg = isprime(x);
			if ( flg == true) count++;
		}
		
		scan.close();
		System.out.println(count);
	}
	
	public static boolean isprime(int x) {
		
		if (x == 2) return true;
		
		if (x < 2 || x % 2 == 0) return false;
		
		int i = 3;
		
		while ( i <= Math.sqrt((double)x)) {
			if (x % i == 0) return false;
			
			i += 2;
		}
		
		return true;
	}
}

