// ALDS1_1_C Prime Numbers
import java.io.*;

class Main {
   public static void main(String[] args) {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

      try {
         int cnt = 0;
         int n = Integer.parseInt(br.readLine());
         int[] x = new int[n];
         for (int i = 0; i < n; i++) {
            x[i] = Integer.parseInt(br.readLine());
         }
         for (int i = 0; i < n; i++) {
            if (isPrime(x[i])) cnt++;
         }
         System.out.println(cnt);
      }
      catch (Exception e) {
         e.printStackTrace();
      }
   }
   static boolean isPrime(int x) {
      if (x == 2) return true;
      if (x < 2 || x % 2 == 0) return false;
      int i = 3;
      while (i <= Math.sqrt(x)) {
         if (x % i == 0) return false;
         i = i + 2;
      }
      return true;
   }
} import java.io.*; io.* java class Main {
   public static void main(String[] args) {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

      try {
         int cnt = 0;
         int n = Integer.parseInt(br.readLine());
         int[] x = new int[n];
         for (int i = 0; i < n; i++) {
            x[i] = Integer.parseInt(br.readLine());
         }
         for (int i = 0; i < n; i++) {
            if (isPrime(x[i])) cnt++;
         }
         System.out.println(cnt);
      }
      catch (Exception e) {
         e.printStackTrace();
      }
   }
   static boolean isPrime(int x) {
      if (x == 2) return true;
      if (x < 2 || x % 2 == 0) return false;
      int i = 3;
      while (i <= Math.sqrt(x)) {
         if (x % i == 0) return false;
         i = i + 2;
      }
      return true;
   }
} Main public static void main(String[] args) {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

      try {
         int cnt = 0;
         int n = Integer.parseInt(br.readLine());
         int[] x = new int[n];
         for (int i = 0; i < n; i++) {
            x[i] = Integer.parseInt(br.readLine());
         }
         for (int i = 0; i < n; i++) {
            if (isPrime(x[i])) cnt++;
         }
         System.out.println(cnt);
      }
      catch (Exception e) {
         e.printStackTrace();
      }
   } main {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

      try {
         int cnt = 0;
         int n = Integer.parseInt(br.readLine());
         int[] x = new int[n];
         for (int i = 0; i < n; i++) {
            x[i] = Integer.parseInt(br.readLine());
         }
         for (int i = 0; i < n; i++) {
            if (isPrime(x[i])) cnt++;
         }
         System.out.println(cnt);
      }
      catch (Exception e) {
         e.printStackTrace();
      }
   } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) try {
         int cnt = 0;
         int n = Integer.parseInt(br.readLine());
         int[] x = new int[n];
         for (int i = 0; i < n; i++) {
            x[i] = Integer.parseInt(br.readLine());
         }
         for (int i = 0; i < n; i++) {
            if (isPrime(x[i])) cnt++;
         }
         System.out.println(cnt);
      }
      catch (Exception e) {
         e.printStackTrace();
      } catch (Exception e) {
         e.printStackTrace();
      } Exception e {
         e.printStackTrace();
      } e.printStackTrace() e.printStackTrace e {
         int cnt = 0;
         int n = Integer.parseInt(br.readLine());
         int[] x = new int[n];
         for (int i = 0; i < n; i++) {
            x[i] = Integer.parseInt(br.readLine());
         }
         for (int i = 0; i < n; i++) {
            if (isPrime(x[i])) cnt++;
         }
         System.out.println(cnt);
      } int cnt = 0; cnt 0 int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int[] x = new int[n]; x new int[n] n for (int i = 0; i < n; i++) {
            x[i] = Integer.parseInt(br.readLine());
         } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            x[i] = Integer.parseInt(br.readLine());
         } {
            x[i] = Integer.parseInt(br.readLine());
         } x[i] = Integer.parseInt(br.readLine()) x[i] x i Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for (int i = 0; i < n; i++) {
            if (isPrime(x[i])) cnt++;
         } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if (isPrime(x[i])) cnt++;
         } {
            if (isPrime(x[i])) cnt++;
         } if (isPrime(x[i])) cnt++; isPrime(x[i]) isPrime x[i] x i cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args static boolean isPrime(int x) {
      if (x == 2) return true;
      if (x < 2 || x % 2 == 0) return false;
      int i = 3;
      while (i <= Math.sqrt(x)) {
         if (x % i == 0) return false;
         i = i + 2;
      }
      return true;
   } isPrime {
      if (x == 2) return true;
      if (x < 2 || x % 2 == 0) return false;
      int i = 3;
      while (i <= Math.sqrt(x)) {
         if (x % i == 0) return false;
         i = i + 2;
      }
      return true;
   } if (x == 2) return true; x == 2 x 2 return true; true if (x < 2 || x % 2 == 0) return false; x < 2 || x % 2 == 0 x < 2 x 2 x % 2 == 0 x % 2 x 2 0 return false; false int i = 3; i 3 while (i <= Math.sqrt(x)) {
         if (x % i == 0) return false;
         i = i + 2;
      } i <= Math.sqrt(x) i Math.sqrt(x) Math.sqrt Math x {
         if (x % i == 0) return false;
         i = i + 2;
      } if (x % i == 0) return false; x % i == 0 x % i x i 0 return false; false i = i + 2 i i + 2 i 2 return true; true int x x
// ALDS1_1_C Prime Numbers
import java.io.*;

class Main {
   public static void main(String[] args) {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

      try {
         int cnt = 0;
         int n = Integer.parseInt(br.readLine());
         int[] x = new int[n];
         for (int i = 0; i < n; i++) {
            x[i] = Integer.parseInt(br.readLine());
         }
         for (int i = 0; i < n; i++) {
            if (isPrime(x[i])) cnt++;
         }
         System.out.println(cnt);
      }
      catch (Exception e) {
         e.printStackTrace();
      }
   }
   static boolean isPrime(int x) {
      if (x == 2) return true;
      if (x < 2 || x % 2 == 0) return false;
      int i = 3;
      while (i <= Math.sqrt(x)) {
         if (x % i == 0) return false;
         i = i + 2;
      }
      return true;
   }
}