import java.util.Scanner;

class Main { 
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
    int count = 0;
    
    while (N != 0) {
      int num = in.nextInt();
      if (isPrime(num)) count++;
      N--;
    }
    
    System.out.println(count);
  }
  
  public static boolean isPrime(int x) {
    if      (x == 2)     return true;
    else if (x % 2 == 0) return false;
    else {
      // if if x has a factor, then it has one less than or equal to sqrt(x),
      // so for efficiency we only need to check i <= sqrt(N) or equivalently i*i <= x
      for (int i = 3; i * i <= x; i += 2) {
        if (x % i == 0) return false;
      }
      return true;
    }
  }
} import java.util.Scanner; Scanner java.util class Main { 
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
    int count = 0;
    
    while (N != 0) {
      int num = in.nextInt();
      if (isPrime(num)) count++;
      N--;
    }
    
    System.out.println(count);
  }
  
  public static boolean isPrime(int x) {
    if      (x == 2)     return true;
    else if (x % 2 == 0) return false;
    else {
      // if if x has a factor, then it has one less than or equal to sqrt(x),
      // so for efficiency we only need to check i <= sqrt(N) or equivalently i*i <= x
      for (int i = 3; i * i <= x; i += 2) {
        if (x % i == 0) return false;
      }
      return true;
    }
  }
} Main public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
    int count = 0;
    
    while (N != 0) {
      int num = in.nextInt();
      if (isPrime(num)) count++;
      N--;
    }
    
    System.out.println(count);
  } main {
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
    int count = 0;
    
    while (N != 0) {
      int num = in.nextInt();
      if (isPrime(num)) count++;
      N--;
    }
    
    System.out.println(count);
  } Scanner in = new Scanner(System.in); in new Scanner(System.in) int N = in.nextInt(); N in.nextInt() in.nextInt in int count = 0; count 0 while (N != 0) {
      int num = in.nextInt();
      if (isPrime(num)) count++;
      N--;
    } N != 0 N 0 {
      int num = in.nextInt();
      if (isPrime(num)) count++;
      N--;
    } int num = in.nextInt(); num in.nextInt() in.nextInt in if (isPrime(num)) count++; isPrime(num) isPrime num count++ count N-- N System.out.println(count) System.out.println System.out System System.out count String[] args args public static boolean isPrime(int x) {
    if      (x == 2)     return true;
    else if (x % 2 == 0) return false;
    else {
      // if if x has a factor, then it has one less than or equal to sqrt(x),
      // so for efficiency we only need to check i <= sqrt(N) or equivalently i*i <= x
      for (int i = 3; i * i <= x; i += 2) {
        if (x % i == 0) return false;
      }
      return true;
    }
  } isPrime {
    if      (x == 2)     return true;
    else if (x % 2 == 0) return false;
    else {
      // if if x has a factor, then it has one less than or equal to sqrt(x),
      // so for efficiency we only need to check i <= sqrt(N) or equivalently i*i <= x
      for (int i = 3; i * i <= x; i += 2) {
        if (x % i == 0) return false;
      }
      return true;
    }
  } if      (x == 2)     return true;
    else if (x % 2 == 0) return false;
    else {
      // if if x has a factor, then it has one less than or equal to sqrt(x),
      // so for efficiency we only need to check i <= sqrt(N) or equivalently i*i <= x
      for (int i = 3; i * i <= x; i += 2) {
        if (x % i == 0) return false;
      }
      return true;
    } x == 2 x 2 return true; true if (x % 2 == 0) return false;
    else {
      // if if x has a factor, then it has one less than or equal to sqrt(x),
      // so for efficiency we only need to check i <= sqrt(N) or equivalently i*i <= x
      for (int i = 3; i * i <= x; i += 2) {
        if (x % i == 0) return false;
      }
      return true;
    } x % 2 == 0 x % 2 x 2 0 return false; false {
      // if if x has a factor, then it has one less than or equal to sqrt(x),
      // so for efficiency we only need to check i <= sqrt(N) or equivalently i*i <= x
      for (int i = 3; i * i <= x; i += 2) {
        if (x % i == 0) return false;
      }
      return true;
    } for (int i = 3; i * i <= x; i += 2) {
        if (x % i == 0) return false;
      } int i = 3; int i = 3; i 3 i * i <= x i * i i i x i += 2 i += 2 i 2 {
        if (x % i == 0) return false;
      } {
        if (x % i == 0) return false;
      } if (x % i == 0) return false; x % i == 0 x % i x i 0 return false; false return true; true int x x
import java.util.Scanner;

class Main { 
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int N = in.nextInt();
    int count = 0;
    
    while (N != 0) {
      int num = in.nextInt();
      if (isPrime(num)) count++;
      N--;
    }
    
    System.out.println(count);
  }
  
  public static boolean isPrime(int x) {
    if      (x == 2)     return true;
    else if (x % 2 == 0) return false;
    else {
      // if if x has a factor, then it has one less than or equal to sqrt(x),
      // so for efficiency we only need to check i <= sqrt(N) or equivalently i*i <= x
      for (int i = 3; i * i <= x; i += 2) {
        if (x % i == 0) return false;
      }
      return true;
    }
  }
}