import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int cnt = 0;

    for(int i = 0; i < n; ++i) {
    	if(isPrime(sc.nextInt())){
    		cnt += 1;
    	}
    }

    System.out.println(cnt);
  }

  public static boolean isPrime(int p) {
  	if(p == 2) return true;
  	if(p % 2 == 0) return false;
	for(int q = 3; q < Math.sqrt(p) + 1; q += 2){
		if(p % q == 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 cnt = 0;

    for(int i = 0; i < n; ++i) {
    	if(isPrime(sc.nextInt())){
    		cnt += 1;
    	}
    }

    System.out.println(cnt);
  }

  public static boolean isPrime(int p) {
  	if(p == 2) return true;
  	if(p % 2 == 0) return false;
	for(int q = 3; q < Math.sqrt(p) + 1; q += 2){
		if(p % q == 0){
			return false;
		}
	}
  	return true;
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int cnt = 0;

    for(int i = 0; i < n; ++i) {
    	if(isPrime(sc.nextInt())){
    		cnt += 1;
    	}
    }

    System.out.println(cnt);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int cnt = 0;

    for(int i = 0; i < n; ++i) {
    	if(isPrime(sc.nextInt())){
    		cnt += 1;
    	}
    }

    System.out.println(cnt);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int cnt = 0; cnt 0 for(int i = 0; i < n; ++i) {
    	if(isPrime(sc.nextInt())){
    		cnt += 1;
    	}
    } int i = 0; int i = 0; i 0 i < n i n ++i ++i i {
    	if(isPrime(sc.nextInt())){
    		cnt += 1;
    	}
    } {
    	if(isPrime(sc.nextInt())){
    		cnt += 1;
    	}
    } if(isPrime(sc.nextInt())){
    		cnt += 1;
    	} isPrime(sc.nextInt()) isPrime sc.nextInt() sc.nextInt sc {
    		cnt += 1;
    	} cnt += 1 cnt 1 System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public static boolean isPrime(int p) {
  	if(p == 2) return true;
  	if(p % 2 == 0) return false;
	for(int q = 3; q < Math.sqrt(p) + 1; q += 2){
		if(p % q == 0){
			return false;
		}
	}
  	return true;
  } isPrime {
  	if(p == 2) return true;
  	if(p % 2 == 0) return false;
	for(int q = 3; q < Math.sqrt(p) + 1; q += 2){
		if(p % q == 0){
			return false;
		}
	}
  	return true;
  } if(p == 2) return true; p == 2 p 2 return true; true if(p % 2 == 0) return false; p % 2 == 0 p % 2 p 2 0 return false; false for(int q = 3; q < Math.sqrt(p) + 1; q += 2){
		if(p % q == 0){
			return false;
		}
	} int q = 3; int q = 3; q 3 q < Math.sqrt(p) + 1 q Math.sqrt(p) + 1 Math.sqrt(p) Math.sqrt Math p 1 q += 2 q += 2 q 2 {
		if(p % q == 0){
			return false;
		}
	} {
		if(p % q == 0){
			return false;
		}
	} if(p % q == 0){
			return false;
		} p % q == 0 p % q p q 0 {
			return false;
		} return false; false return true; true int p p
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int cnt = 0;

    for(int i = 0; i < n; ++i) {
    	if(isPrime(sc.nextInt())){
    		cnt += 1;
    	}
    }

    System.out.println(cnt);
  }

  public static boolean isPrime(int p) {
  	if(p == 2) return true;
  	if(p % 2 == 0) return false;
	for(int q = 3; q < Math.sqrt(p) + 1; q += 2){
		if(p % q == 0){
			return false;
		}
	}
  	return true;
  }
}