import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int cnt = 0;
		for(int i = 0; i < n; i++){
			if(judge(sc.nextInt())) cnt++;
		}
		System.out.println(cnt);
	}
	static boolean judge(int tmp){
		if(tmp==2 || tmp==3 || tmp==5 || tmp==7) return true;
		if(tmp % 2 == 0) return false;
		for(int i = 3; i <= Math.sqrt(tmp); i++){
			if(tmp % i == 0) return false;
		}
		return true;
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int cnt = 0;
		for(int i = 0; i < n; i++){
			if(judge(sc.nextInt())) cnt++;
		}
		System.out.println(cnt);
	}
	static boolean judge(int tmp){
		if(tmp==2 || tmp==3 || tmp==5 || tmp==7) return true;
		if(tmp % 2 == 0) return false;
		for(int i = 3; i <= Math.sqrt(tmp); i++){
			if(tmp % i == 0) return false;
		}
		return true;
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int cnt = 0;
		for(int i = 0; i < n; i++){
			if(judge(sc.nextInt())) cnt++;
		}
		System.out.println(cnt);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int cnt = 0;
		for(int i = 0; i < n; i++){
			if(judge(sc.nextInt())) cnt++;
		}
		System.out.println(cnt);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int cnt = 0; cnt 0 for(int i = 0; i < n; i++){
			if(judge(sc.nextInt())) cnt++;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			if(judge(sc.nextInt())) cnt++;
		} {
			if(judge(sc.nextInt())) cnt++;
		} if(judge(sc.nextInt())) cnt++; judge(sc.nextInt()) judge sc.nextInt() sc.nextInt sc cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args static boolean judge(int tmp){
		if(tmp==2 || tmp==3 || tmp==5 || tmp==7) return true;
		if(tmp % 2 == 0) return false;
		for(int i = 3; i <= Math.sqrt(tmp); i++){
			if(tmp % i == 0) return false;
		}
		return true;
	} judge {
		if(tmp==2 || tmp==3 || tmp==5 || tmp==7) return true;
		if(tmp % 2 == 0) return false;
		for(int i = 3; i <= Math.sqrt(tmp); i++){
			if(tmp % i == 0) return false;
		}
		return true;
	} if(tmp==2 || tmp==3 || tmp==5 || tmp==7) return true; tmp==2 || tmp==3 || tmp==5 || tmp==7 tmp==5 tmp==2 || tmp==3 || tmp==5 || tmp==7 tmp==2 tmp 2 tmp==3 tmp 3 tmp==5 tmp 5 tmp==7 tmp 7 return true; true if(tmp % 2 == 0) return false; tmp % 2 == 0 tmp % 2 tmp 2 0 return false; false for(int i = 3; i <= Math.sqrt(tmp); i++){
			if(tmp % i == 0) return false;
		} int i = 3; int i = 3; i 3 i <= Math.sqrt(tmp) i Math.sqrt(tmp) Math.sqrt Math tmp i++ i++ i {
			if(tmp % i == 0) return false;
		} {
			if(tmp % i == 0) return false;
		} if(tmp % i == 0) return false; tmp % i == 0 tmp % i tmp i 0 return false; false return true; true int tmp tmp public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int cnt = 0;
		for(int i = 0; i < n; i++){
			if(judge(sc.nextInt())) cnt++;
		}
		System.out.println(cnt);
	}
	static boolean judge(int tmp){
		if(tmp==2 || tmp==3 || tmp==5 || tmp==7) return true;
		if(tmp % 2 == 0) return false;
		for(int i = 3; i <= Math.sqrt(tmp); i++){
			if(tmp % 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 cnt = 0;
		for(int i = 0; i < n; i++){
			if(judge(sc.nextInt())) cnt++;
		}
		System.out.println(cnt);
	}
	static boolean judge(int tmp){
		if(tmp==2 || tmp==3 || tmp==5 || tmp==7) return true;
		if(tmp % 2 == 0) return false;
		for(int i = 3; i <= Math.sqrt(tmp); i++){
			if(tmp % i == 0) return false;
		}
		return true;
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int cnt = 0;
		for(int i = 0; i < n; i++){
			if(judge(sc.nextInt())) cnt++;
		}
		System.out.println(cnt);
	}
	static boolean judge(int tmp){
		if(tmp==2 || tmp==3 || tmp==5 || tmp==7) return true;
		if(tmp % 2 == 0) return false;
		for(int i = 3; i <= Math.sqrt(tmp); i++){
			if(tmp % i == 0) return false;
		}
		return true;
	}
}