import java.util.Scanner;
class Prime{
	double x;
	Prime(int X){
		x=X;
	}
	boolean isPrime() {
		if(x==2) {
			return true;
		}
		else if(x<2||x%2==0) {
			return false;
		}
		else {
			int i=3;
			while(i<=Math.sqrt(x)) {
				if(x%i==0) {
					return false;
				}
				i=i+2;
			}
		}
		return true;
	}
}
public class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		Prime [] p=new Prime [n];
		int sum=0;
		for(int i=0;i<n;i++) {
			p[i]=new Prime(sc.nextInt());
			p[i].isPrime();
			if(p[i].isPrime()==true) {
				sum+=1;
			}
		}
		System.out.println(sum);
		sc.close();
	}
}
 import java.util.Scanner; Scanner java.util class Prime{
	double x;
	Prime(int X){
		x=X;
	}
	boolean isPrime() {
		if(x==2) {
			return true;
		}
		else if(x<2||x%2==0) {
			return false;
		}
		else {
			int i=3;
			while(i<=Math.sqrt(x)) {
				if(x%i==0) {
					return false;
				}
				i=i+2;
			}
		}
		return true;
	}
} Prime double x; x Prime(int X){
		x=X;
	} Prime {
		x=X;
	} x=X x X int X X boolean isPrime() {
		if(x==2) {
			return true;
		}
		else if(x<2||x%2==0) {
			return false;
		}
		else {
			int i=3;
			while(i<=Math.sqrt(x)) {
				if(x%i==0) {
					return false;
				}
				i=i+2;
			}
		}
		return true;
	} isPrime {
		if(x==2) {
			return true;
		}
		else if(x<2||x%2==0) {
			return false;
		}
		else {
			int i=3;
			while(i<=Math.sqrt(x)) {
				if(x%i==0) {
					return false;
				}
				i=i+2;
			}
		}
		return true;
	} if(x==2) {
			return true;
		}
		else if(x<2||x%2==0) {
			return false;
		}
		else {
			int i=3;
			while(i<=Math.sqrt(x)) {
				if(x%i==0) {
					return false;
				}
				i=i+2;
			}
		} x==2 x 2 {
			return true;
		} return true; true if(x<2||x%2==0) {
			return false;
		}
		else {
			int i=3;
			while(i<=Math.sqrt(x)) {
				if(x%i==0) {
					return false;
				}
				i=i+2;
			}
		} x<2||x%2==0 x<2 x 2 x%2==0 x%2 x 2 0 {
			return false;
		} return false; false {
			int i=3;
			while(i<=Math.sqrt(x)) {
				if(x%i==0) {
					return false;
				}
				i=i+2;
			}
		} int i=3; i 3 while(i<=Math.sqrt(x)) {
				if(x%i==0) {
					return false;
				}
				i=i+2;
			} i<=Math.sqrt(x) i Math.sqrt(x) Math.sqrt Math x {
				if(x%i==0) {
					return false;
				}
				i=i+2;
			} if(x%i==0) {
					return false;
				} x%i==0 x%i x i 0 {
					return false;
				} return false; false i=i+2 i i+2 i 2 return true; true public class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		Prime [] p=new Prime [n];
		int sum=0;
		for(int i=0;i<n;i++) {
			p[i]=new Prime(sc.nextInt());
			p[i].isPrime();
			if(p[i].isPrime()==true) {
				sum+=1;
			}
		}
		System.out.println(sum);
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		Prime [] p=new Prime [n];
		int sum=0;
		for(int i=0;i<n;i++) {
			p[i]=new Prime(sc.nextInt());
			p[i].isPrime();
			if(p[i].isPrime()==true) {
				sum+=1;
			}
		}
		System.out.println(sum);
		sc.close();
	} main {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		Prime [] p=new Prime [n];
		int sum=0;
		for(int i=0;i<n;i++) {
			p[i]=new Prime(sc.nextInt());
			p[i].isPrime();
			if(p[i].isPrime()==true) {
				sum+=1;
			}
		}
		System.out.println(sum);
		sc.close();
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc Prime [] p=new Prime [n]; p new Prime [n] n int sum=0; sum 0 for(int i=0;i<n;i++) {
			p[i]=new Prime(sc.nextInt());
			p[i].isPrime();
			if(p[i].isPrime()==true) {
				sum+=1;
			}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			p[i]=new Prime(sc.nextInt());
			p[i].isPrime();
			if(p[i].isPrime()==true) {
				sum+=1;
			}
		} {
			p[i]=new Prime(sc.nextInt());
			p[i].isPrime();
			if(p[i].isPrime()==true) {
				sum+=1;
			}
		} p[i]=new Prime(sc.nextInt()) p[i] p i new Prime(sc.nextInt()) p[i].isPrime() p[i].isPrime p[i] p i if(p[i].isPrime()==true) {
				sum+=1;
			} p[i].isPrime()==true p[i].isPrime() p[i].isPrime p[i] p i true {
				sum+=1;
			} sum+=1 sum 1 System.out.println(sum) System.out.println System.out System System.out sum sc.close() sc.close sc String[] args args public class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		Prime [] p=new Prime [n];
		int sum=0;
		for(int i=0;i<n;i++) {
			p[i]=new Prime(sc.nextInt());
			p[i].isPrime();
			if(p[i].isPrime()==true) {
				sum+=1;
			}
		}
		System.out.println(sum);
		sc.close();
	}
} public class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		Prime [] p=new Prime [n];
		int sum=0;
		for(int i=0;i<n;i++) {
			p[i]=new Prime(sc.nextInt());
			p[i].isPrime();
			if(p[i].isPrime()==true) {
				sum+=1;
			}
		}
		System.out.println(sum);
		sc.close();
	}
} Main
import java.util.Scanner;
class Prime{
	double x;
	Prime(int X){
		x=X;
	}
	boolean isPrime() {
		if(x==2) {
			return true;
		}
		else if(x<2||x%2==0) {
			return false;
		}
		else {
			int i=3;
			while(i<=Math.sqrt(x)) {
				if(x%i==0) {
					return false;
				}
				i=i+2;
			}
		}
		return true;
	}
}
public class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		Prime [] p=new Prime [n];
		int sum=0;
		for(int i=0;i<n;i++) {
			p[i]=new Prime(sc.nextInt());
			p[i].isPrime();
			if(p[i].isPrime()==true) {
				sum+=1;
			}
		}
		System.out.println(sum);
		sc.close();
	}
}

