import java.util.Scanner;
class Main {
	public static void main(String[] args){
		final int Number=100;
		try(Scanner sc = new Scanner(System.in)){
			int N = Integer.parseInt(sc.next());
			int[] p=new int[N];
			for(int i=0;i<N;i++) p[i] = Integer.parseInt(sc.next());
			int cnt=0;
			for(int i=0;i<N;i++){
				if(isPrime(p[i])){
					cnt++;
				}
			}
			System.out.println(cnt);
		}
	}
	public static boolean isPrime(int p){
		boolean ans=true;
		for(int i=2;i*i<=p;i++){
			ans=ans&&(p%i!=0);
		}
		return ans;
	}
} import java.util.Scanner; Scanner java.util class Main {
	public static void main(String[] args){
		final int Number=100;
		try(Scanner sc = new Scanner(System.in)){
			int N = Integer.parseInt(sc.next());
			int[] p=new int[N];
			for(int i=0;i<N;i++) p[i] = Integer.parseInt(sc.next());
			int cnt=0;
			for(int i=0;i<N;i++){
				if(isPrime(p[i])){
					cnt++;
				}
			}
			System.out.println(cnt);
		}
	}
	public static boolean isPrime(int p){
		boolean ans=true;
		for(int i=2;i*i<=p;i++){
			ans=ans&&(p%i!=0);
		}
		return ans;
	}
} Main public static void main(String[] args){
		final int Number=100;
		try(Scanner sc = new Scanner(System.in)){
			int N = Integer.parseInt(sc.next());
			int[] p=new int[N];
			for(int i=0;i<N;i++) p[i] = Integer.parseInt(sc.next());
			int cnt=0;
			for(int i=0;i<N;i++){
				if(isPrime(p[i])){
					cnt++;
				}
			}
			System.out.println(cnt);
		}
	} main {
		final int Number=100;
		try(Scanner sc = new Scanner(System.in)){
			int N = Integer.parseInt(sc.next());
			int[] p=new int[N];
			for(int i=0;i<N;i++) p[i] = Integer.parseInt(sc.next());
			int cnt=0;
			for(int i=0;i<N;i++){
				if(isPrime(p[i])){
					cnt++;
				}
			}
			System.out.println(cnt);
		}
	} final int Number=100; Number 100 try(Scanner sc = new Scanner(System.in)){
			int N = Integer.parseInt(sc.next());
			int[] p=new int[N];
			for(int i=0;i<N;i++) p[i] = Integer.parseInt(sc.next());
			int cnt=0;
			for(int i=0;i<N;i++){
				if(isPrime(p[i])){
					cnt++;
				}
			}
			System.out.println(cnt);
		} {
			int N = Integer.parseInt(sc.next());
			int[] p=new int[N];
			for(int i=0;i<N;i++) p[i] = Integer.parseInt(sc.next());
			int cnt=0;
			for(int i=0;i<N;i++){
				if(isPrime(p[i])){
					cnt++;
				}
			}
			System.out.println(cnt);
		} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[] p=new int[N]; p new int[N] N for(int i=0;i<N;i++) p[i] = Integer.parseInt(sc.next()); int i=0; int i=0; i 0 i<N i N i++ i++ i p[i] = Integer.parseInt(sc.next()); p[i] = Integer.parseInt(sc.next()) p[i] p i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int cnt=0; cnt 0 for(int i=0;i<N;i++){
				if(isPrime(p[i])){
					cnt++;
				}
			} int i=0; int i=0; i 0 i<N i N i++ i++ i {
				if(isPrime(p[i])){
					cnt++;
				}
			} {
				if(isPrime(p[i])){
					cnt++;
				}
			} if(isPrime(p[i])){
					cnt++;
				} isPrime(p[i]) isPrime p[i] p i {
					cnt++;
				} cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public static boolean isPrime(int p){
		boolean ans=true;
		for(int i=2;i*i<=p;i++){
			ans=ans&&(p%i!=0);
		}
		return ans;
	} isPrime {
		boolean ans=true;
		for(int i=2;i*i<=p;i++){
			ans=ans&&(p%i!=0);
		}
		return ans;
	} boolean ans=true; ans true for(int i=2;i*i<=p;i++){
			ans=ans&&(p%i!=0);
		} int i=2; int i=2; i 2 i*i<=p i*i i i p i++ i++ i {
			ans=ans&&(p%i!=0);
		} {
			ans=ans&&(p%i!=0);
		} ans=ans&&(p%i!=0) ans ans&&(p%i!=0) ans (p%i!=0) p%i p i 0 return ans; ans int p p
import java.util.Scanner;
class Main {
	public static void main(String[] args){
		final int Number=100;
		try(Scanner sc = new Scanner(System.in)){
			int N = Integer.parseInt(sc.next());
			int[] p=new int[N];
			for(int i=0;i<N;i++) p[i] = Integer.parseInt(sc.next());
			int cnt=0;
			for(int i=0;i<N;i++){
				if(isPrime(p[i])){
					cnt++;
				}
			}
			System.out.println(cnt);
		}
	}
	public static boolean isPrime(int p){
		boolean ans=true;
		for(int i=2;i*i<=p;i++){
			ans=ans&&(p%i!=0);
		}
		return ans;
	}
}