import java.util.Scanner;

public class Main{


	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int num[]= new int[n];
		for (int i=0;i<n;++i){
			num[i]=sc.nextInt();
		}
		int div;
		int counter=0;

		for (int i=0;i<n;++i){
			div =0;
			if (num[i]==2) ++counter;
			if (num[i]%2==0) ++div;
			for (int j=3;j<=(double)Math.pow(num[i],0.5) && div ==0;j=j+2){
				if (num[i]%j == 0) ++div;
			}
			if (div==0) ++counter;
		}
		System.out.println(counter);
	}

} import java.util.Scanner; Scanner java.util public class Main{


	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int num[]= new int[n];
		for (int i=0;i<n;++i){
			num[i]=sc.nextInt();
		}
		int div;
		int counter=0;

		for (int i=0;i<n;++i){
			div =0;
			if (num[i]==2) ++counter;
			if (num[i]%2==0) ++div;
			for (int j=3;j<=(double)Math.pow(num[i],0.5) && div ==0;j=j+2){
				if (num[i]%j == 0) ++div;
			}
			if (div==0) ++counter;
		}
		System.out.println(counter);
	}

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

		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int num[]= new int[n];
		for (int i=0;i<n;++i){
			num[i]=sc.nextInt();
		}
		int div;
		int counter=0;

		for (int i=0;i<n;++i){
			div =0;
			if (num[i]==2) ++counter;
			if (num[i]%2==0) ++div;
			for (int j=3;j<=(double)Math.pow(num[i],0.5) && div ==0;j=j+2){
				if (num[i]%j == 0) ++div;
			}
			if (div==0) ++counter;
		}
		System.out.println(counter);
	} main {

		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int num[]= new int[n];
		for (int i=0;i<n;++i){
			num[i]=sc.nextInt();
		}
		int div;
		int counter=0;

		for (int i=0;i<n;++i){
			div =0;
			if (num[i]==2) ++counter;
			if (num[i]%2==0) ++div;
			for (int j=3;j<=(double)Math.pow(num[i],0.5) && div ==0;j=j+2){
				if (num[i]%j == 0) ++div;
			}
			if (div==0) ++counter;
		}
		System.out.println(counter);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int num[]= new int[n]; num new int[n] n for (int i=0;i<n;++i){
			num[i]=sc.nextInt();
		} int i=0; int i=0; i 0 i<n i n ++i ++i i {
			num[i]=sc.nextInt();
		} {
			num[i]=sc.nextInt();
		} num[i]=sc.nextInt() num[i] num i sc.nextInt() sc.nextInt sc int div; div int counter=0; counter 0 for (int i=0;i<n;++i){
			div =0;
			if (num[i]==2) ++counter;
			if (num[i]%2==0) ++div;
			for (int j=3;j<=(double)Math.pow(num[i],0.5) && div ==0;j=j+2){
				if (num[i]%j == 0) ++div;
			}
			if (div==0) ++counter;
		} int i=0; int i=0; i 0 i<n i n ++i ++i i {
			div =0;
			if (num[i]==2) ++counter;
			if (num[i]%2==0) ++div;
			for (int j=3;j<=(double)Math.pow(num[i],0.5) && div ==0;j=j+2){
				if (num[i]%j == 0) ++div;
			}
			if (div==0) ++counter;
		} {
			div =0;
			if (num[i]==2) ++counter;
			if (num[i]%2==0) ++div;
			for (int j=3;j<=(double)Math.pow(num[i],0.5) && div ==0;j=j+2){
				if (num[i]%j == 0) ++div;
			}
			if (div==0) ++counter;
		} div =0 div 0 if (num[i]==2) ++counter; num[i]==2 num[i] num i 2 ++counter counter if (num[i]%2==0) ++div; num[i]%2==0 num[i]%2 num[i] num i 2 0 ++div div for (int j=3;j<=(double)Math.pow(num[i],0.5) && div ==0;j=j+2){
				if (num[i]%j == 0) ++div;
			} int j=3; int j=3; j 3 j<=(double)Math.pow(num[i],0.5) && div ==0 j<=(double)Math.pow(num[i],0.5) j (double)Math.pow(num[i],0.5) Math.pow Math num[i] num i 0.5 div ==0 div 0 j=j+2 j=j+2 j j+2 j 2 {
				if (num[i]%j == 0) ++div;
			} {
				if (num[i]%j == 0) ++div;
			} if (num[i]%j == 0) ++div; num[i]%j == 0 num[i]%j num[i] num i j 0 ++div div if (div==0) ++counter; div==0 div 0 ++counter counter System.out.println(counter) System.out.println System.out System System.out counter String args[] args public class Main{


	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int num[]= new int[n];
		for (int i=0;i<n;++i){
			num[i]=sc.nextInt();
		}
		int div;
		int counter=0;

		for (int i=0;i<n;++i){
			div =0;
			if (num[i]==2) ++counter;
			if (num[i]%2==0) ++div;
			for (int j=3;j<=(double)Math.pow(num[i],0.5) && div ==0;j=j+2){
				if (num[i]%j == 0) ++div;
			}
			if (div==0) ++counter;
		}
		System.out.println(counter);
	}

} public class Main{


	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int num[]= new int[n];
		for (int i=0;i<n;++i){
			num[i]=sc.nextInt();
		}
		int div;
		int counter=0;

		for (int i=0;i<n;++i){
			div =0;
			if (num[i]==2) ++counter;
			if (num[i]%2==0) ++div;
			for (int j=3;j<=(double)Math.pow(num[i],0.5) && div ==0;j=j+2){
				if (num[i]%j == 0) ++div;
			}
			if (div==0) ++counter;
		}
		System.out.println(counter);
	}

} Main
import java.util.Scanner;

public class Main{


	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int num[]= new int[n];
		for (int i=0;i<n;++i){
			num[i]=sc.nextInt();
		}
		int div;
		int counter=0;

		for (int i=0;i<n;++i){
			div =0;
			if (num[i]==2) ++counter;
			if (num[i]%2==0) ++div;
			for (int j=3;j<=(double)Math.pow(num[i],0.5) && div ==0;j=j+2){
				if (num[i]%j == 0) ++div;
			}
			if (div==0) ++counter;
		}
		System.out.println(counter);
	}

}
