import java.util.*;
import java.io.*;
class Main{
	public static void main(String[]args){
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out, true);
		int n=in.nextInt();
		int count=0;
		for(int i=0;i<n;i++){
			int a=in.nextInt();
			if(check_prime(a))
				count++;
		}
		out.println(count);
	}
	public static boolean check_prime(int n){
		if(n<=1)
			return false;
		if(n<=3)
			return true;

		if(n%2==0 || n%3==0)
			return false;

		for(int i=5; i*i<=n; i=i+6){
			if(n%i==0 || n%(i+2)==0)
				return false;
		}
		return true;
	}
} import java.util.*; util.* java import java.io.*; io.* java class Main{
	public static void main(String[]args){
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out, true);
		int n=in.nextInt();
		int count=0;
		for(int i=0;i<n;i++){
			int a=in.nextInt();
			if(check_prime(a))
				count++;
		}
		out.println(count);
	}
	public static boolean check_prime(int n){
		if(n<=1)
			return false;
		if(n<=3)
			return true;

		if(n%2==0 || n%3==0)
			return false;

		for(int i=5; i*i<=n; i=i+6){
			if(n%i==0 || n%(i+2)==0)
				return false;
		}
		return true;
	}
} Main public static void main(String[]args){
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out, true);
		int n=in.nextInt();
		int count=0;
		for(int i=0;i<n;i++){
			int a=in.nextInt();
			if(check_prime(a))
				count++;
		}
		out.println(count);
	} main {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out, true);
		int n=in.nextInt();
		int count=0;
		for(int i=0;i<n;i++){
			int a=in.nextInt();
			if(check_prime(a))
				count++;
		}
		out.println(count);
	} Scanner in=new Scanner(System.in); in new Scanner(System.in) PrintWriter out=new PrintWriter(System.out, true); out new PrintWriter(System.out, true) int n=in.nextInt(); n in.nextInt() in.nextInt in int count=0; count 0 for(int i=0;i<n;i++){
			int a=in.nextInt();
			if(check_prime(a))
				count++;
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			int a=in.nextInt();
			if(check_prime(a))
				count++;
		} {
			int a=in.nextInt();
			if(check_prime(a))
				count++;
		} int a=in.nextInt(); a in.nextInt() in.nextInt in if(check_prime(a))
				count++; check_prime(a) check_prime a count++ count out.println(count) out.println out count String[]args args public static boolean check_prime(int n){
		if(n<=1)
			return false;
		if(n<=3)
			return true;

		if(n%2==0 || n%3==0)
			return false;

		for(int i=5; i*i<=n; i=i+6){
			if(n%i==0 || n%(i+2)==0)
				return false;
		}
		return true;
	} check_prime {
		if(n<=1)
			return false;
		if(n<=3)
			return true;

		if(n%2==0 || n%3==0)
			return false;

		for(int i=5; i*i<=n; i=i+6){
			if(n%i==0 || n%(i+2)==0)
				return false;
		}
		return true;
	} if(n<=1)
			return false; n<=1 n 1 return false; false if(n<=3)
			return true; n<=3 n 3 return true; true if(n%2==0 || n%3==0)
			return false; n%2==0 || n%3==0 n%2==0 n%2 n 2 0 n%3==0 n%3 n 3 0 return false; false for(int i=5; i*i<=n; i=i+6){
			if(n%i==0 || n%(i+2)==0)
				return false;
		} int i=5; int i=5; i 5 i*i<=n i*i i i n i=i+6 i=i+6 i i+6 i 6 {
			if(n%i==0 || n%(i+2)==0)
				return false;
		} {
			if(n%i==0 || n%(i+2)==0)
				return false;
		} if(n%i==0 || n%(i+2)==0)
				return false; n%i==0 || n%(i+2)==0 n%i==0 n%i n i 0 n%(i+2)==0 n%(i+2) n (i+2) i 2 0 return false; false return true; true int n n
import java.util.*;
import java.io.*;
class Main{
	public static void main(String[]args){
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out, true);
		int n=in.nextInt();
		int count=0;
		for(int i=0;i<n;i++){
			int a=in.nextInt();
			if(check_prime(a))
				count++;
		}
		out.println(count);
	}
	public static boolean check_prime(int n){
		if(n<=1)
			return false;
		if(n<=3)
			return true;

		if(n%2==0 || n%3==0)
			return false;

		for(int i=5; i*i<=n; i=i+6){
			if(n%i==0 || n%(i+2)==0)
				return false;
		}
		return true;
	}
}
