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

class Main
{
  public static void main(String[] args)
  {
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      int n = Integer.parseInt(br.readLine());
      int count = 0;

      for(int i = 0; i < n; i++){
        long x = Long.parseLong(br.readLine());
        if(isprime(x)) count++;
      }
      System.out.println(count);

    }catch(Exception e){
      System.out.println(e);
    }
  }

  public static boolean isprime(long 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)
  {
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      int n = Integer.parseInt(br.readLine());
      int count = 0;

      for(int i = 0; i < n; i++){
        long x = Long.parseLong(br.readLine());
        if(isprime(x)) count++;
      }
      System.out.println(count);

    }catch(Exception e){
      System.out.println(e);
    }
  }

  public static boolean isprime(long 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)
  {
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      int n = Integer.parseInt(br.readLine());
      int count = 0;

      for(int i = 0; i < n; i++){
        long x = Long.parseLong(br.readLine());
        if(isprime(x)) count++;
      }
      System.out.println(count);

    }catch(Exception e){
      System.out.println(e);
    }
  } main {
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      int n = Integer.parseInt(br.readLine());
      int count = 0;

      for(int i = 0; i < n; i++){
        long x = Long.parseLong(br.readLine());
        if(isprime(x)) count++;
      }
      System.out.println(count);

    }catch(Exception e){
      System.out.println(e);
    }
  } try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      int n = Integer.parseInt(br.readLine());
      int count = 0;

      for(int i = 0; i < n; i++){
        long x = Long.parseLong(br.readLine());
        if(isprime(x)) count++;
      }
      System.out.println(count);

    }catch(Exception e){
      System.out.println(e);
    } catch(Exception e){
      System.out.println(e);
    } Exception e {
      System.out.println(e);
    } System.out.println(e) System.out.println System.out System System.out e {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      int n = Integer.parseInt(br.readLine());
      int count = 0;

      for(int i = 0; i < n; i++){
        long x = Long.parseLong(br.readLine());
        if(isprime(x)) count++;
      }
      System.out.println(count);

    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int count = 0; count 0 for(int i = 0; i < n; i++){
        long x = Long.parseLong(br.readLine());
        if(isprime(x)) count++;
      } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
        long x = Long.parseLong(br.readLine());
        if(isprime(x)) count++;
      } {
        long x = Long.parseLong(br.readLine());
        if(isprime(x)) count++;
      } long x = Long.parseLong(br.readLine()); x Long.parseLong(br.readLine()) Long.parseLong Long br.readLine() br.readLine br if(isprime(x)) count++; isprime(x) isprime x count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public static boolean isprime(long 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 long x x
/* ALDS1_1_C */
import java.io.*;

class Main
{
  public static void main(String[] args)
  {
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      int n = Integer.parseInt(br.readLine());
      int count = 0;

      for(int i = 0; i < n; i++){
        long x = Long.parseLong(br.readLine());
        if(isprime(x)) count++;
      }
      System.out.println(count);

    }catch(Exception e){
      System.out.println(e);
    }
  }

  public static boolean isprime(long 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;
  }
}