import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
 
public class Main {
	public void exec() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        Prime p = new Prime();
        int n = Integer.parseInt(br.readLine());
        int[] v = new int[n];
        int max = 0;
        for(int i=0; i<n; i++) {
        	v[i] = Integer.parseInt(br.readLine());
        	if(max < v[i])
        		max=v[i];
        }
        p.checkPrime(10000);
        int countPrime = 0;
        for(int i=0; i<n; i++) {
        	if(p.isPrime(v[i]))
        		countPrime++;
        }
        out.println(countPrime);
        out.flush();
    }

    public static void main(String[] args) throws IOException {
        new Main().exec();
    }
}

class Prime {
	private static final int CAPACITY = 10001;
	private boolean[] isNotPrime = new boolean[CAPACITY];
	private int checkMax = 1;
	private int[] primes = new int[CAPACITY];
	private int ptrPrimes = 0;
	
	public boolean isPrime(int n) {
		if(CAPACITY*CAPACITY <= n) {
			throw new IllegalArgumentException();
		}else if(CAPACITY <= n){
			return checkPrimeSub(n);
		}else{
			return !isNotPrime[n];
		}
	}
	
	public void checkPrime(int target) {
		if(CAPACITY<target) throw new IllegalArgumentException();
		if(target<checkMax) return;
		for(int i=checkMax+1; i<=target; i++) {
			if (checkPrimeSub(i)) {
				primes[ptrPrimes++]=i;
			} else {
				isNotPrime[i]=true;
			}
		}
		checkMax=target;
	}
	
	public boolean checkPrimeSub(int i) {
		boolean isPrime = true;
		int maxPrime = i;
		for(int j=0; j<ptrPrimes; j++) {
			if(maxPrime <= primes[j]){
				break;
			}else if(i % primes[j] == 0) {
				isPrime = false;
				break;
			}else{
				maxPrime = i / primes[j];
			}
		}
		return isPrime;
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.PrintWriter; PrintWriter java.io public class Main {
	public void exec() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        Prime p = new Prime();
        int n = Integer.parseInt(br.readLine());
        int[] v = new int[n];
        int max = 0;
        for(int i=0; i<n; i++) {
        	v[i] = Integer.parseInt(br.readLine());
        	if(max < v[i])
        		max=v[i];
        }
        p.checkPrime(10000);
        int countPrime = 0;
        for(int i=0; i<n; i++) {
        	if(p.isPrime(v[i]))
        		countPrime++;
        }
        out.println(countPrime);
        out.flush();
    }

    public static void main(String[] args) throws IOException {
        new Main().exec();
    }
} Main public void exec() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        Prime p = new Prime();
        int n = Integer.parseInt(br.readLine());
        int[] v = new int[n];
        int max = 0;
        for(int i=0; i<n; i++) {
        	v[i] = Integer.parseInt(br.readLine());
        	if(max < v[i])
        		max=v[i];
        }
        p.checkPrime(10000);
        int countPrime = 0;
        for(int i=0; i<n; i++) {
        	if(p.isPrime(v[i]))
        		countPrime++;
        }
        out.println(countPrime);
        out.flush();
    } exec {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        Prime p = new Prime();
        int n = Integer.parseInt(br.readLine());
        int[] v = new int[n];
        int max = 0;
        for(int i=0; i<n; i++) {
        	v[i] = Integer.parseInt(br.readLine());
        	if(max < v[i])
        		max=v[i];
        }
        p.checkPrime(10000);
        int countPrime = 0;
        for(int i=0; i<n; i++) {
        	if(p.isPrime(v[i]))
        		countPrime++;
        }
        out.println(countPrime);
        out.flush();
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) Prime p = new Prime(); p new Prime() int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int[] v = new int[n]; v new int[n] n int max = 0; max 0 for(int i=0; i<n; i++) {
        	v[i] = Integer.parseInt(br.readLine());
        	if(max < v[i])
        		max=v[i];
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
        	v[i] = Integer.parseInt(br.readLine());
        	if(max < v[i])
        		max=v[i];
        } {
        	v[i] = Integer.parseInt(br.readLine());
        	if(max < v[i])
        		max=v[i];
        } v[i] = Integer.parseInt(br.readLine()) v[i] v i Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br if(max < v[i])
        		max=v[i]; max < v[i] max v[i] v i max=v[i] max v[i] v i p.checkPrime(10000) p.checkPrime p 10000 int countPrime = 0; countPrime 0 for(int i=0; i<n; i++) {
        	if(p.isPrime(v[i]))
        		countPrime++;
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
        	if(p.isPrime(v[i]))
        		countPrime++;
        } {
        	if(p.isPrime(v[i]))
        		countPrime++;
        } if(p.isPrime(v[i]))
        		countPrime++; p.isPrime(v[i]) p.isPrime p v[i] v i countPrime++ countPrime out.println(countPrime) out.println out countPrime out.flush() out.flush out public static void main(String[] args) throws IOException {
        new Main().exec();
    } main {
        new Main().exec();
    } new Main().exec() new Main().exec new Main() String[] args args class Prime {
	private static final int CAPACITY = 10001;
	private boolean[] isNotPrime = new boolean[CAPACITY];
	private int checkMax = 1;
	private int[] primes = new int[CAPACITY];
	private int ptrPrimes = 0;
	
	public boolean isPrime(int n) {
		if(CAPACITY*CAPACITY <= n) {
			throw new IllegalArgumentException();
		}else if(CAPACITY <= n){
			return checkPrimeSub(n);
		}else{
			return !isNotPrime[n];
		}
	}
	
	public void checkPrime(int target) {
		if(CAPACITY<target) throw new IllegalArgumentException();
		if(target<checkMax) return;
		for(int i=checkMax+1; i<=target; i++) {
			if (checkPrimeSub(i)) {
				primes[ptrPrimes++]=i;
			} else {
				isNotPrime[i]=true;
			}
		}
		checkMax=target;
	}
	
	public boolean checkPrimeSub(int i) {
		boolean isPrime = true;
		int maxPrime = i;
		for(int j=0; j<ptrPrimes; j++) {
			if(maxPrime <= primes[j]){
				break;
			}else if(i % primes[j] == 0) {
				isPrime = false;
				break;
			}else{
				maxPrime = i / primes[j];
			}
		}
		return isPrime;
	}
} Prime private static final int CAPACITY = 10001; CAPACITY 10001 private boolean[] isNotPrime = new boolean[CAPACITY]; isNotPrime new boolean[CAPACITY] CAPACITY private int checkMax = 1; checkMax 1 private int[] primes = new int[CAPACITY]; primes new int[CAPACITY] CAPACITY private int ptrPrimes = 0; ptrPrimes 0 public boolean isPrime(int n) {
		if(CAPACITY*CAPACITY <= n) {
			throw new IllegalArgumentException();
		}else if(CAPACITY <= n){
			return checkPrimeSub(n);
		}else{
			return !isNotPrime[n];
		}
	} isPrime {
		if(CAPACITY*CAPACITY <= n) {
			throw new IllegalArgumentException();
		}else if(CAPACITY <= n){
			return checkPrimeSub(n);
		}else{
			return !isNotPrime[n];
		}
	} if(CAPACITY*CAPACITY <= n) {
			throw new IllegalArgumentException();
		}else if(CAPACITY <= n){
			return checkPrimeSub(n);
		}else{
			return !isNotPrime[n];
		} CAPACITY*CAPACITY <= n CAPACITY*CAPACITY CAPACITY CAPACITY n {
			throw new IllegalArgumentException();
		} throw new IllegalArgumentException(); new IllegalArgumentException() if(CAPACITY <= n){
			return checkPrimeSub(n);
		}else{
			return !isNotPrime[n];
		} CAPACITY <= n CAPACITY n {
			return checkPrimeSub(n);
		} return checkPrimeSub(n); checkPrimeSub(n) checkPrimeSub n {
			return !isNotPrime[n];
		} return !isNotPrime[n]; !isNotPrime[n] isNotPrime[n] isNotPrime n int n n public void checkPrime(int target) {
		if(CAPACITY<target) throw new IllegalArgumentException();
		if(target<checkMax) return;
		for(int i=checkMax+1; i<=target; i++) {
			if (checkPrimeSub(i)) {
				primes[ptrPrimes++]=i;
			} else {
				isNotPrime[i]=true;
			}
		}
		checkMax=target;
	} checkPrime {
		if(CAPACITY<target) throw new IllegalArgumentException();
		if(target<checkMax) return;
		for(int i=checkMax+1; i<=target; i++) {
			if (checkPrimeSub(i)) {
				primes[ptrPrimes++]=i;
			} else {
				isNotPrime[i]=true;
			}
		}
		checkMax=target;
	} if(CAPACITY<target) throw new IllegalArgumentException(); CAPACITY<target CAPACITY target throw new IllegalArgumentException(); new IllegalArgumentException() if(target<checkMax) return; target<checkMax target checkMax return; for(int i=checkMax+1; i<=target; i++) {
			if (checkPrimeSub(i)) {
				primes[ptrPrimes++]=i;
			} else {
				isNotPrime[i]=true;
			}
		} int i=checkMax+1; int i=checkMax+1; i checkMax+1 checkMax 1 i<=target i target i++ i++ i {
			if (checkPrimeSub(i)) {
				primes[ptrPrimes++]=i;
			} else {
				isNotPrime[i]=true;
			}
		} {
			if (checkPrimeSub(i)) {
				primes[ptrPrimes++]=i;
			} else {
				isNotPrime[i]=true;
			}
		} if (checkPrimeSub(i)) {
				primes[ptrPrimes++]=i;
			} else {
				isNotPrime[i]=true;
			} checkPrimeSub(i) checkPrimeSub i {
				primes[ptrPrimes++]=i;
			} primes[ptrPrimes++]=i primes[ptrPrimes++] primes ptrPrimes++ ptrPrimes i {
				isNotPrime[i]=true;
			} isNotPrime[i]=true isNotPrime[i] isNotPrime i true checkMax=target checkMax target int target target public boolean checkPrimeSub(int i) {
		boolean isPrime = true;
		int maxPrime = i;
		for(int j=0; j<ptrPrimes; j++) {
			if(maxPrime <= primes[j]){
				break;
			}else if(i % primes[j] == 0) {
				isPrime = false;
				break;
			}else{
				maxPrime = i / primes[j];
			}
		}
		return isPrime;
	} checkPrimeSub {
		boolean isPrime = true;
		int maxPrime = i;
		for(int j=0; j<ptrPrimes; j++) {
			if(maxPrime <= primes[j]){
				break;
			}else if(i % primes[j] == 0) {
				isPrime = false;
				break;
			}else{
				maxPrime = i / primes[j];
			}
		}
		return isPrime;
	} boolean isPrime = true; isPrime true int maxPrime = i; maxPrime i for(int j=0; j<ptrPrimes; j++) {
			if(maxPrime <= primes[j]){
				break;
			}else if(i % primes[j] == 0) {
				isPrime = false;
				break;
			}else{
				maxPrime = i / primes[j];
			}
		} int j=0; int j=0; j 0 j<ptrPrimes j ptrPrimes j++ j++ j {
			if(maxPrime <= primes[j]){
				break;
			}else if(i % primes[j] == 0) {
				isPrime = false;
				break;
			}else{
				maxPrime = i / primes[j];
			}
		} {
			if(maxPrime <= primes[j]){
				break;
			}else if(i % primes[j] == 0) {
				isPrime = false;
				break;
			}else{
				maxPrime = i / primes[j];
			}
		} if(maxPrime <= primes[j]){
				break;
			}else if(i % primes[j] == 0) {
				isPrime = false;
				break;
			}else{
				maxPrime = i / primes[j];
			} maxPrime <= primes[j] maxPrime primes[j] primes j {
				break;
			} break; if(i % primes[j] == 0) {
				isPrime = false;
				break;
			}else{
				maxPrime = i / primes[j];
			} i % primes[j] == 0 i % primes[j] i primes[j] primes j 0 {
				isPrime = false;
				break;
			} isPrime = false isPrime false break; {
				maxPrime = i / primes[j];
			} maxPrime = i / primes[j] maxPrime i / primes[j] i primes[j] primes j return isPrime; isPrime int i i public class Main {
	public void exec() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        Prime p = new Prime();
        int n = Integer.parseInt(br.readLine());
        int[] v = new int[n];
        int max = 0;
        for(int i=0; i<n; i++) {
        	v[i] = Integer.parseInt(br.readLine());
        	if(max < v[i])
        		max=v[i];
        }
        p.checkPrime(10000);
        int countPrime = 0;
        for(int i=0; i<n; i++) {
        	if(p.isPrime(v[i]))
        		countPrime++;
        }
        out.println(countPrime);
        out.flush();
    }

    public static void main(String[] args) throws IOException {
        new Main().exec();
    }
} public class Main {
	public void exec() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        Prime p = new Prime();
        int n = Integer.parseInt(br.readLine());
        int[] v = new int[n];
        int max = 0;
        for(int i=0; i<n; i++) {
        	v[i] = Integer.parseInt(br.readLine());
        	if(max < v[i])
        		max=v[i];
        }
        p.checkPrime(10000);
        int countPrime = 0;
        for(int i=0; i<n; i++) {
        	if(p.isPrime(v[i]))
        		countPrime++;
        }
        out.println(countPrime);
        out.flush();
    }

    public static void main(String[] args) throws IOException {
        new Main().exec();
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
 
public class Main {
	public void exec() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        Prime p = new Prime();
        int n = Integer.parseInt(br.readLine());
        int[] v = new int[n];
        int max = 0;
        for(int i=0; i<n; i++) {
        	v[i] = Integer.parseInt(br.readLine());
        	if(max < v[i])
        		max=v[i];
        }
        p.checkPrime(10000);
        int countPrime = 0;
        for(int i=0; i<n; i++) {
        	if(p.isPrime(v[i]))
        		countPrime++;
        }
        out.println(countPrime);
        out.flush();
    }

    public static void main(String[] args) throws IOException {
        new Main().exec();
    }
}

class Prime {
	private static final int CAPACITY = 10001;
	private boolean[] isNotPrime = new boolean[CAPACITY];
	private int checkMax = 1;
	private int[] primes = new int[CAPACITY];
	private int ptrPrimes = 0;
	
	public boolean isPrime(int n) {
		if(CAPACITY*CAPACITY <= n) {
			throw new IllegalArgumentException();
		}else if(CAPACITY <= n){
			return checkPrimeSub(n);
		}else{
			return !isNotPrime[n];
		}
	}
	
	public void checkPrime(int target) {
		if(CAPACITY<target) throw new IllegalArgumentException();
		if(target<checkMax) return;
		for(int i=checkMax+1; i<=target; i++) {
			if (checkPrimeSub(i)) {
				primes[ptrPrimes++]=i;
			} else {
				isNotPrime[i]=true;
			}
		}
		checkMax=target;
	}
	
	public boolean checkPrimeSub(int i) {
		boolean isPrime = true;
		int maxPrime = i;
		for(int j=0; j<ptrPrimes; j++) {
			if(maxPrime <= primes[j]){
				break;
			}else if(i % primes[j] == 0) {
				isPrime = false;
				break;
			}else{
				maxPrime = i / primes[j];
			}
		}
		return isPrime;
	}
}