// a program which finds the number of prime numbers in the given list

import java.util.*;
import java.lang.*;

class Main{

  public static void main(String[] args){
    final int N;
    int A, num = 0;           // num : the number of prime numbers in the given list

    Scanner scanner = new Scanner(System.in);
    N = scanner.nextInt();

    for( int i = 0; i<N; i++ ){
      A = scanner.nextInt();
      num += isPrime(A);
    }

    scanner.close();
    System.out.println(num);
  }

  // a function for judging whether the given number is a prime number or not
  // Returned Value 0: not prime number 1: prime number
  static int isPrime(int n){

    for( int i = 2; i<=Math.sqrt(n); i++ ){
      if( n % i == 0 )
        return 0;
    }

    return 1;
  }// the end of the method: "isPrime"

}// the end of the class: "Main"
 import java.util.*; util.* java import java.lang.*; lang.* java class Main{

  public static void main(String[] args){
    final int N;
    int A, num = 0;           // num : the number of prime numbers in the given list

    Scanner scanner = new Scanner(System.in);
    N = scanner.nextInt();

    for( int i = 0; i<N; i++ ){
      A = scanner.nextInt();
      num += isPrime(A);
    }

    scanner.close();
    System.out.println(num);
  }

  // a function for judging whether the given number is a prime number or not
  // Returned Value 0: not prime number 1: prime number
  static int isPrime(int n){

    for( int i = 2; i<=Math.sqrt(n); i++ ){
      if( n % i == 0 )
        return 0;
    }

    return 1;
  }// the end of the method: "isPrime"

}// the end of the class: "Main" Main public static void main(String[] args){
    final int N;
    int A, num = 0;           // num : the number of prime numbers in the given list

    Scanner scanner = new Scanner(System.in);
    N = scanner.nextInt();

    for( int i = 0; i<N; i++ ){
      A = scanner.nextInt();
      num += isPrime(A);
    }

    scanner.close();
    System.out.println(num);
  } main {
    final int N;
    int A, num = 0;           // num : the number of prime numbers in the given list

    Scanner scanner = new Scanner(System.in);
    N = scanner.nextInt();

    for( int i = 0; i<N; i++ ){
      A = scanner.nextInt();
      num += isPrime(A);
    }

    scanner.close();
    System.out.println(num);
  } final int N; N int A A num = 0; num 0 Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) N = scanner.nextInt() N scanner.nextInt() scanner.nextInt scanner for( int i = 0; i<N; i++ ){
      A = scanner.nextInt();
      num += isPrime(A);
    } int i = 0; int i = 0; i 0 i<N i N i++ i++ i {
      A = scanner.nextInt();
      num += isPrime(A);
    } {
      A = scanner.nextInt();
      num += isPrime(A);
    } A = scanner.nextInt() A scanner.nextInt() scanner.nextInt scanner num += isPrime(A) num isPrime(A) isPrime A scanner.close() scanner.close scanner System.out.println(num) System.out.println System.out System System.out num String[] args args // a function for judging whether the given number is a prime number or not
  // Returned Value 0: not prime number 1: prime number
  static int isPrime(int n){

    for( int i = 2; i<=Math.sqrt(n); i++ ){
      if( n % i == 0 )
        return 0;
    }

    return 1;
  }// the end of the method: "isPrime" isPrime {

    for( int i = 2; i<=Math.sqrt(n); i++ ){
      if( n % i == 0 )
        return 0;
    }

    return 1;
  } for( int i = 2; i<=Math.sqrt(n); i++ ){
      if( n % i == 0 )
        return 0;
    } int i = 2; int i = 2; i 2 i<=Math.sqrt(n) i Math.sqrt(n) Math.sqrt Math n i++ i++ i {
      if( n % i == 0 )
        return 0;
    } {
      if( n % i == 0 )
        return 0;
    } if( n % i == 0 )
        return 0; n % i == 0 n % i n i 0 return 0; 0 return 1; 1 int n n
// a program which finds the number of prime numbers in the given list

import java.util.*;
import java.lang.*;

class Main{

  public static void main(String[] args){
    final int N;
    int A, num = 0;           // num : the number of prime numbers in the given list

    Scanner scanner = new Scanner(System.in);
    N = scanner.nextInt();

    for( int i = 0; i<N; i++ ){
      A = scanner.nextInt();
      num += isPrime(A);
    }

    scanner.close();
    System.out.println(num);
  }

  // a function for judging whether the given number is a prime number or not
  // Returned Value 0: not prime number 1: prime number
  static int isPrime(int n){

    for( int i = 2; i<=Math.sqrt(n); i++ ){
      if( n % i == 0 )
        return 0;
    }

    return 1;
  }// the end of the method: "isPrime"

}// the end of the class: "Main"

