import java.util.*;

class Main {
	public static void main(String args[]){
		ArrayList<Integer> ar = new ArrayList<Integer>();
		int cnt = 0;
		Scanner sc = new Scanner(System.in);
		int size = sc.nextInt();
		for(int i = 0;i < size;i++){
			int num = sc.nextInt();
			if(hantei(num)){
				cnt++;
			}
		}
		System.out.println(cnt);
	}
	
	
	private static boolean hantei(int x){
		int n = (int) Math.ceil(Math.sqrt((double)x));
		if(x == 2){
			return true;
		}
		for(int j = 2;j <= n;j++){
			if(x % j == 0){
				return false;
			}
		}
		return true;	
	}
	
} import java.util.*; util.* java class Main {
	public static void main(String args[]){
		ArrayList<Integer> ar = new ArrayList<Integer>();
		int cnt = 0;
		Scanner sc = new Scanner(System.in);
		int size = sc.nextInt();
		for(int i = 0;i < size;i++){
			int num = sc.nextInt();
			if(hantei(num)){
				cnt++;
			}
		}
		System.out.println(cnt);
	}
	
	
	private static boolean hantei(int x){
		int n = (int) Math.ceil(Math.sqrt((double)x));
		if(x == 2){
			return true;
		}
		for(int j = 2;j <= n;j++){
			if(x % j == 0){
				return false;
			}
		}
		return true;	
	}
	
} Main public static void main(String args[]){
		ArrayList<Integer> ar = new ArrayList<Integer>();
		int cnt = 0;
		Scanner sc = new Scanner(System.in);
		int size = sc.nextInt();
		for(int i = 0;i < size;i++){
			int num = sc.nextInt();
			if(hantei(num)){
				cnt++;
			}
		}
		System.out.println(cnt);
	} main {
		ArrayList<Integer> ar = new ArrayList<Integer>();
		int cnt = 0;
		Scanner sc = new Scanner(System.in);
		int size = sc.nextInt();
		for(int i = 0;i < size;i++){
			int num = sc.nextInt();
			if(hantei(num)){
				cnt++;
			}
		}
		System.out.println(cnt);
	} ArrayList<Integer> ar = new ArrayList<Integer>(); ar new ArrayList<Integer>() int cnt = 0; cnt 0 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int size = sc.nextInt(); size sc.nextInt() sc.nextInt sc for(int i = 0;i < size;i++){
			int num = sc.nextInt();
			if(hantei(num)){
				cnt++;
			}
		} int i = 0; int i = 0; i 0 i < size i size i++ i++ i {
			int num = sc.nextInt();
			if(hantei(num)){
				cnt++;
			}
		} {
			int num = sc.nextInt();
			if(hantei(num)){
				cnt++;
			}
		} int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc if(hantei(num)){
				cnt++;
			} hantei(num) hantei num {
				cnt++;
			} cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String args[] args private static boolean hantei(int x){
		int n = (int) Math.ceil(Math.sqrt((double)x));
		if(x == 2){
			return true;
		}
		for(int j = 2;j <= n;j++){
			if(x % j == 0){
				return false;
			}
		}
		return true;	
	} hantei {
		int n = (int) Math.ceil(Math.sqrt((double)x));
		if(x == 2){
			return true;
		}
		for(int j = 2;j <= n;j++){
			if(x % j == 0){
				return false;
			}
		}
		return true;	
	} int n = (int) Math.ceil(Math.sqrt((double)x)); n (int) Math.ceil(Math.sqrt((double)x)) Math.ceil Math Math.sqrt((double)x) Math.sqrt Math (double)x if(x == 2){
			return true;
		} x == 2 x 2 {
			return true;
		} return true; true for(int j = 2;j <= n;j++){
			if(x % j == 0){
				return false;
			}
		} int j = 2; int j = 2; j 2 j <= n j n j++ j++ j {
			if(x % j == 0){
				return false;
			}
		} {
			if(x % j == 0){
				return false;
			}
		} if(x % j == 0){
				return false;
			} x % j == 0 x % j x j 0 {
				return false;
			} return false; false return true; true int x x
import java.util.*;

class Main {
	public static void main(String args[]){
		ArrayList<Integer> ar = new ArrayList<Integer>();
		int cnt = 0;
		Scanner sc = new Scanner(System.in);
		int size = sc.nextInt();
		for(int i = 0;i < size;i++){
			int num = sc.nextInt();
			if(hantei(num)){
				cnt++;
			}
		}
		System.out.println(cnt);
	}
	
	
	private static boolean hantei(int x){
		int n = (int) Math.ceil(Math.sqrt((double)x));
		if(x == 2){
			return true;
		}
		for(int j = 2;j <= n;j++){
			if(x % j == 0){
				return false;
			}
		}
		return true;	
	}
	
}