import java.util.*;

public class Main {
	
	static boolean A[];
	
	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt(),D[]=new int[n],max=0,cnt=0;
		
		for(int i=0;i<n;i++) {
			D[i]=Integer.parseInt(in.next());
			if(D[i]>max)max=D[i];
		}
		sieve(max);
		for(int i=0;i<D.length;i++) {
			if(!A[D[i]])cnt++;
		}
		System.out.println(cnt);
	}
		
	static void sieve(int n) {
		A=new boolean[n+1];
		for(int i=2;i<Math.sqrt(A.length);i++) {
			if(!A[i]) {
				int p=i,s=p*2;
				for(int j=s;j<A.length;j+=p)A[j]=true;
			}
		}
	}

} import java.util.*; util.* java public class Main {
	
	static boolean A[];
	
	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt(),D[]=new int[n],max=0,cnt=0;
		
		for(int i=0;i<n;i++) {
			D[i]=Integer.parseInt(in.next());
			if(D[i]>max)max=D[i];
		}
		sieve(max);
		for(int i=0;i<D.length;i++) {
			if(!A[D[i]])cnt++;
		}
		System.out.println(cnt);
	}
		
	static void sieve(int n) {
		A=new boolean[n+1];
		for(int i=2;i<Math.sqrt(A.length);i++) {
			if(!A[i]) {
				int p=i,s=p*2;
				for(int j=s;j<A.length;j+=p)A[j]=true;
			}
		}
	}

} Main static boolean A[]; A public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt(),D[]=new int[n],max=0,cnt=0;
		
		for(int i=0;i<n;i++) {
			D[i]=Integer.parseInt(in.next());
			if(D[i]>max)max=D[i];
		}
		sieve(max);
		for(int i=0;i<D.length;i++) {
			if(!A[D[i]])cnt++;
		}
		System.out.println(cnt);
	} main {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt(),D[]=new int[n],max=0,cnt=0;
		
		for(int i=0;i<n;i++) {
			D[i]=Integer.parseInt(in.next());
			if(D[i]>max)max=D[i];
		}
		sieve(max);
		for(int i=0;i<D.length;i++) {
			if(!A[D[i]])cnt++;
		}
		System.out.println(cnt);
	} Scanner in=new Scanner(System.in); in new Scanner(System.in) int n=in.nextInt() n in.nextInt() in.nextInt in D[]=new int[n] D new int[n] n max=0 max 0 cnt=0; cnt 0 for(int i=0;i<n;i++) {
			D[i]=Integer.parseInt(in.next());
			if(D[i]>max)max=D[i];
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			D[i]=Integer.parseInt(in.next());
			if(D[i]>max)max=D[i];
		} {
			D[i]=Integer.parseInt(in.next());
			if(D[i]>max)max=D[i];
		} D[i]=Integer.parseInt(in.next()) D[i] D i Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in if(D[i]>max)max=D[i]; D[i]>max D[i] D i max max=D[i] max D[i] D i sieve(max) sieve max for(int i=0;i<D.length;i++) {
			if(!A[D[i]])cnt++;
		} int i=0; int i=0; i 0 i<D.length i D.length D D.length i++ i++ i {
			if(!A[D[i]])cnt++;
		} {
			if(!A[D[i]])cnt++;
		} if(!A[D[i]])cnt++; !A[D[i]] A[D[i]] A D[i] D i cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args static void sieve(int n) {
		A=new boolean[n+1];
		for(int i=2;i<Math.sqrt(A.length);i++) {
			if(!A[i]) {
				int p=i,s=p*2;
				for(int j=s;j<A.length;j+=p)A[j]=true;
			}
		}
	} sieve {
		A=new boolean[n+1];
		for(int i=2;i<Math.sqrt(A.length);i++) {
			if(!A[i]) {
				int p=i,s=p*2;
				for(int j=s;j<A.length;j+=p)A[j]=true;
			}
		}
	} A=new boolean[n+1] A new boolean[n+1] n+1 n 1 for(int i=2;i<Math.sqrt(A.length);i++) {
			if(!A[i]) {
				int p=i,s=p*2;
				for(int j=s;j<A.length;j+=p)A[j]=true;
			}
		} int i=2; int i=2; i 2 i<Math.sqrt(A.length) i Math.sqrt(A.length) Math.sqrt Math A.length A A.length i++ i++ i {
			if(!A[i]) {
				int p=i,s=p*2;
				for(int j=s;j<A.length;j+=p)A[j]=true;
			}
		} {
			if(!A[i]) {
				int p=i,s=p*2;
				for(int j=s;j<A.length;j+=p)A[j]=true;
			}
		} if(!A[i]) {
				int p=i,s=p*2;
				for(int j=s;j<A.length;j+=p)A[j]=true;
			} !A[i] A[i] A i {
				int p=i,s=p*2;
				for(int j=s;j<A.length;j+=p)A[j]=true;
			} int p=i p i s=p*2; s p*2 p 2 for(int j=s;j<A.length;j+=p)A[j]=true; int j=s; int j=s; j s j<A.length j A.length A A.length j+=p j+=p j p A[j]=true; A[j]=true A[j] A j true int n n public class Main {
	
	static boolean A[];
	
	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt(),D[]=new int[n],max=0,cnt=0;
		
		for(int i=0;i<n;i++) {
			D[i]=Integer.parseInt(in.next());
			if(D[i]>max)max=D[i];
		}
		sieve(max);
		for(int i=0;i<D.length;i++) {
			if(!A[D[i]])cnt++;
		}
		System.out.println(cnt);
	}
		
	static void sieve(int n) {
		A=new boolean[n+1];
		for(int i=2;i<Math.sqrt(A.length);i++) {
			if(!A[i]) {
				int p=i,s=p*2;
				for(int j=s;j<A.length;j+=p)A[j]=true;
			}
		}
	}

} public class Main {
	
	static boolean A[];
	
	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt(),D[]=new int[n],max=0,cnt=0;
		
		for(int i=0;i<n;i++) {
			D[i]=Integer.parseInt(in.next());
			if(D[i]>max)max=D[i];
		}
		sieve(max);
		for(int i=0;i<D.length;i++) {
			if(!A[D[i]])cnt++;
		}
		System.out.println(cnt);
	}
		
	static void sieve(int n) {
		A=new boolean[n+1];
		for(int i=2;i<Math.sqrt(A.length);i++) {
			if(!A[i]) {
				int p=i,s=p*2;
				for(int j=s;j<A.length;j+=p)A[j]=true;
			}
		}
	}

} Main
import java.util.*;

public class Main {
	
	static boolean A[];
	
	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt(),D[]=new int[n],max=0,cnt=0;
		
		for(int i=0;i<n;i++) {
			D[i]=Integer.parseInt(in.next());
			if(D[i]>max)max=D[i];
		}
		sieve(max);
		for(int i=0;i<D.length;i++) {
			if(!A[D[i]])cnt++;
		}
		System.out.println(cnt);
	}
		
	static void sieve(int n) {
		A=new boolean[n+1];
		for(int i=2;i<Math.sqrt(A.length);i++) {
			if(!A[i]) {
				int p=i,s=p*2;
				for(int j=s;j<A.length;j+=p)A[j]=true;
			}
		}
	}

}
