import java.util.*;

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

    for (int i = 0; i < n; i++) {
      cnt = isPrime(sc.nextInt()) ? cnt + 1 : cnt;
    }
    System.out.println(cnt);
  }

  static boolean isPrime(int x) {
    if (x == 2)
      return true;
    if (x < 2 || x % 2 == 0)
      return false;

    // 合成数xはp<=sqrt x を満たす素因子pを持つ
    int sqrt = (int) Math.sqrt((double) x);
    for (int i = 3; i <= sqrt; i = i + 2) {
      if (x % i == 0)
        return false;
    }
    return true;
  }
}
 import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    @SuppressWarnings("resource")
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int cnt = 0;

    for (int i = 0; i < n; i++) {
      cnt = isPrime(sc.nextInt()) ? cnt + 1 : cnt;
    }
    System.out.println(cnt);
  }

  static boolean isPrime(int x) {
    if (x == 2)
      return true;
    if (x < 2 || x % 2 == 0)
      return false;

    // 合成数xはp<=sqrt x を満たす素因子pを持つ
    int sqrt = (int) Math.sqrt((double) x);
    for (int i = 3; i <= sqrt; i = i + 2) {
      if (x % i == 0)
        return false;
    }
    return true;
  }
} Main public static void main(String[] args) {
    @SuppressWarnings("resource")
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int cnt = 0;

    for (int i = 0; i < n; i++) {
      cnt = isPrime(sc.nextInt()) ? cnt + 1 : cnt;
    }
    System.out.println(cnt);
  } main {
    @SuppressWarnings("resource")
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int cnt = 0;

    for (int i = 0; i < n; i++) {
      cnt = isPrime(sc.nextInt()) ? cnt + 1 : cnt;
    }
    System.out.println(cnt);
  } @SuppressWarnings("resource")
    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++) {
      cnt = isPrime(sc.nextInt()) ? cnt + 1 : cnt;
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      cnt = isPrime(sc.nextInt()) ? cnt + 1 : cnt;
    } {
      cnt = isPrime(sc.nextInt()) ? cnt + 1 : cnt;
    } cnt = isPrime(sc.nextInt()) ? cnt + 1 : cnt cnt isPrime(sc.nextInt()) ? cnt + 1 : cnt isPrime(sc.nextInt()) isPrime sc.nextInt() sc.nextInt sc cnt + 1 cnt 1 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;

    // 合成数xはp<=sqrt x を満たす素因子pを持つ
    int sqrt = (int) Math.sqrt((double) x);
    for (int i = 3; i <= sqrt; i = i + 2) {
      if (x % i == 0)
        return false;
    }
    return true;
  } isPrime {
    if (x == 2)
      return true;
    if (x < 2 || x % 2 == 0)
      return false;

    // 合成数xはp<=sqrt x を満たす素因子pを持つ
    int sqrt = (int) Math.sqrt((double) x);
    for (int i = 3; i <= sqrt; i = i + 2) {
      if (x % i == 0)
        return false;
    }
    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 sqrt = (int) Math.sqrt((double) x); sqrt (int) Math.sqrt((double) x) Math.sqrt Math (double) x for (int i = 3; i <= sqrt; i = i + 2) {
      if (x % i == 0)
        return false;
    } int i = 3; int i = 3; i 3 i <= sqrt i sqrt i = i + 2 i = i + 2 i 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 public class Main {
  public static void main(String[] args) {
    @SuppressWarnings("resource")
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int cnt = 0;

    for (int i = 0; i < n; i++) {
      cnt = isPrime(sc.nextInt()) ? cnt + 1 : cnt;
    }
    System.out.println(cnt);
  }

  static boolean isPrime(int x) {
    if (x == 2)
      return true;
    if (x < 2 || x % 2 == 0)
      return false;

    // 合成数xはp<=sqrt x を満たす素因子pを持つ
    int sqrt = (int) Math.sqrt((double) x);
    for (int i = 3; i <= sqrt; i = i + 2) {
      if (x % i == 0)
        return false;
    }
    return true;
  }
} public class Main {
  public static void main(String[] args) {
    @SuppressWarnings("resource")
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int cnt = 0;

    for (int i = 0; i < n; i++) {
      cnt = isPrime(sc.nextInt()) ? cnt + 1 : cnt;
    }
    System.out.println(cnt);
  }

  static boolean isPrime(int x) {
    if (x == 2)
      return true;
    if (x < 2 || x % 2 == 0)
      return false;

    // 合成数xはp<=sqrt x を満たす素因子pを持つ
    int sqrt = (int) Math.sqrt((double) x);
    for (int i = 3; i <= sqrt; i = i + 2) {
      if (x % i == 0)
        return false;
    }
    return true;
  }
} Main
import java.util.*;

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

    for (int i = 0; i < n; i++) {
      cnt = isPrime(sc.nextInt()) ? cnt + 1 : cnt;
    }
    System.out.println(cnt);
  }

  static boolean isPrime(int x) {
    if (x == 2)
      return true;
    if (x < 2 || x % 2 == 0)
      return false;

    // 合成数xはp<=sqrt x を満たす素因子pを持つ
    int sqrt = (int) Math.sqrt((double) x);
    for (int i = 3; i <= sqrt; i = i + 2) {
      if (x % i == 0)
        return false;
    }
    return true;
  }
}

