import java.util.Scanner;

class Main{

	public static void main(String[] args){

		Scanner sc =new Scanner(System.in);

		int n=sc.nextInt();
		int x,count=0;

		for(int i=0;i<n;i++) {

			x=sc.nextInt();

			if(judge_prime(x)) count++;

		}

		System.out.println(count);

	}


	private static  boolean judge_prime(int x) {
		
		if(x<=2) return true;
		
		else if(x%2==0) return false;

		for(int i=3;i<=Math.sqrt(x);i+=2)
			if(x%i==0) return false;

		return true;
	}
} import java.util.Scanner; Scanner java.util class Main{

	public static void main(String[] args){

		Scanner sc =new Scanner(System.in);

		int n=sc.nextInt();
		int x,count=0;

		for(int i=0;i<n;i++) {

			x=sc.nextInt();

			if(judge_prime(x)) count++;

		}

		System.out.println(count);

	}


	private static  boolean judge_prime(int x) {
		
		if(x<=2) return true;
		
		else if(x%2==0) return false;

		for(int i=3;i<=Math.sqrt(x);i+=2)
			if(x%i==0) return false;

		return true;
	}
} Main public static void main(String[] args){

		Scanner sc =new Scanner(System.in);

		int n=sc.nextInt();
		int x,count=0;

		for(int i=0;i<n;i++) {

			x=sc.nextInt();

			if(judge_prime(x)) count++;

		}

		System.out.println(count);

	} main {

		Scanner sc =new Scanner(System.in);

		int n=sc.nextInt();
		int x,count=0;

		for(int i=0;i<n;i++) {

			x=sc.nextInt();

			if(judge_prime(x)) count++;

		}

		System.out.println(count);

	} Scanner sc =new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int x x count=0; count 0 for(int i=0;i<n;i++) {

			x=sc.nextInt();

			if(judge_prime(x)) count++;

		} int i=0; int i=0; i 0 i<n i n i++ i++ i {

			x=sc.nextInt();

			if(judge_prime(x)) count++;

		} {

			x=sc.nextInt();

			if(judge_prime(x)) count++;

		} x=sc.nextInt() x sc.nextInt() sc.nextInt sc if(judge_prime(x)) count++; judge_prime(x) judge_prime x count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args private static  boolean judge_prime(int x) {
		
		if(x<=2) return true;
		
		else if(x%2==0) return false;

		for(int i=3;i<=Math.sqrt(x);i+=2)
			if(x%i==0) return false;

		return true;
	} judge_prime {
		
		if(x<=2) return true;
		
		else if(x%2==0) return false;

		for(int i=3;i<=Math.sqrt(x);i+=2)
			if(x%i==0) return false;

		return true;
	} if(x<=2) return true;
		
		else if(x%2==0) return false; x<=2 x 2 return true; true if(x%2==0) return false; x%2==0 x%2 x 2 0 return false; false for(int i=3;i<=Math.sqrt(x);i+=2)
			if(x%i==0) return false; int i=3; int i=3; i 3 i<=Math.sqrt(x) i Math.sqrt(x) Math.sqrt Math x i+=2 i+=2 i 2 if(x%i==0) return false; if(x%i==0) return false; x%i==0 x%i x i 0 return false; false return true; true int x x
import java.util.Scanner;

class Main{

	public static void main(String[] args){

		Scanner sc =new Scanner(System.in);

		int n=sc.nextInt();
		int x,count=0;

		for(int i=0;i<n;i++) {

			x=sc.nextInt();

			if(judge_prime(x)) count++;

		}

		System.out.println(count);

	}


	private static  boolean judge_prime(int x) {
		
		if(x<=2) return true;
		
		else if(x%2==0) return false;

		for(int i=3;i<=Math.sqrt(x);i+=2)
			if(x%i==0) return false;

		return true;
	}
}
