import java.io.*;

public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      String count = new String(in.readLine());
      int lineCount = Integer.parseInt(count);
      int pFlag = 0;
      int result = 0;
      for(int i = 0; i < lineCount; i++) {
        String num = new String(in.readLine());
        int iNum = Integer.parseInt(num);
        pFlag = 0;
        for(int j = 2; j <= Math.sqrt(iNum); j++) {
          if(iNum % j == 0) {
            pFlag = 1;
            break;
          }
        }
        if(pFlag == 0) {
          result++;
        }
      }
      System.out.println(result);
    } catch(IOException e) {
    }
  }
} import java.io.*; io.* java public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      String count = new String(in.readLine());
      int lineCount = Integer.parseInt(count);
      int pFlag = 0;
      int result = 0;
      for(int i = 0; i < lineCount; i++) {
        String num = new String(in.readLine());
        int iNum = Integer.parseInt(num);
        pFlag = 0;
        for(int j = 2; j <= Math.sqrt(iNum); j++) {
          if(iNum % j == 0) {
            pFlag = 1;
            break;
          }
        }
        if(pFlag == 0) {
          result++;
        }
      }
      System.out.println(result);
    } catch(IOException e) {
    }
  }
} Main public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      String count = new String(in.readLine());
      int lineCount = Integer.parseInt(count);
      int pFlag = 0;
      int result = 0;
      for(int i = 0; i < lineCount; i++) {
        String num = new String(in.readLine());
        int iNum = Integer.parseInt(num);
        pFlag = 0;
        for(int j = 2; j <= Math.sqrt(iNum); j++) {
          if(iNum % j == 0) {
            pFlag = 1;
            break;
          }
        }
        if(pFlag == 0) {
          result++;
        }
      }
      System.out.println(result);
    } catch(IOException e) {
    }
  } main {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      String count = new String(in.readLine());
      int lineCount = Integer.parseInt(count);
      int pFlag = 0;
      int result = 0;
      for(int i = 0; i < lineCount; i++) {
        String num = new String(in.readLine());
        int iNum = Integer.parseInt(num);
        pFlag = 0;
        for(int j = 2; j <= Math.sqrt(iNum); j++) {
          if(iNum % j == 0) {
            pFlag = 1;
            break;
          }
        }
        if(pFlag == 0) {
          result++;
        }
      }
      System.out.println(result);
    } catch(IOException e) {
    }
  } try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      String count = new String(in.readLine());
      int lineCount = Integer.parseInt(count);
      int pFlag = 0;
      int result = 0;
      for(int i = 0; i < lineCount; i++) {
        String num = new String(in.readLine());
        int iNum = Integer.parseInt(num);
        pFlag = 0;
        for(int j = 2; j <= Math.sqrt(iNum); j++) {
          if(iNum % j == 0) {
            pFlag = 1;
            break;
          }
        }
        if(pFlag == 0) {
          result++;
        }
      }
      System.out.println(result);
    } catch(IOException e) {
    } catch(IOException e) {
    } IOException e {
    } {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      String count = new String(in.readLine());
      int lineCount = Integer.parseInt(count);
      int pFlag = 0;
      int result = 0;
      for(int i = 0; i < lineCount; i++) {
        String num = new String(in.readLine());
        int iNum = Integer.parseInt(num);
        pFlag = 0;
        for(int j = 2; j <= Math.sqrt(iNum); j++) {
          if(iNum % j == 0) {
            pFlag = 1;
            break;
          }
        }
        if(pFlag == 0) {
          result++;
        }
      }
      System.out.println(result);
    } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) String count = new String(in.readLine()); count new String(in.readLine()) int lineCount = Integer.parseInt(count); lineCount Integer.parseInt(count) Integer.parseInt Integer count int pFlag = 0; pFlag 0 int result = 0; result 0 for(int i = 0; i < lineCount; i++) {
        String num = new String(in.readLine());
        int iNum = Integer.parseInt(num);
        pFlag = 0;
        for(int j = 2; j <= Math.sqrt(iNum); j++) {
          if(iNum % j == 0) {
            pFlag = 1;
            break;
          }
        }
        if(pFlag == 0) {
          result++;
        }
      } int i = 0; int i = 0; i 0 i < lineCount i lineCount i++ i++ i {
        String num = new String(in.readLine());
        int iNum = Integer.parseInt(num);
        pFlag = 0;
        for(int j = 2; j <= Math.sqrt(iNum); j++) {
          if(iNum % j == 0) {
            pFlag = 1;
            break;
          }
        }
        if(pFlag == 0) {
          result++;
        }
      } {
        String num = new String(in.readLine());
        int iNum = Integer.parseInt(num);
        pFlag = 0;
        for(int j = 2; j <= Math.sqrt(iNum); j++) {
          if(iNum % j == 0) {
            pFlag = 1;
            break;
          }
        }
        if(pFlag == 0) {
          result++;
        }
      } String num = new String(in.readLine()); num new String(in.readLine()) int iNum = Integer.parseInt(num); iNum Integer.parseInt(num) Integer.parseInt Integer num pFlag = 0 pFlag 0 for(int j = 2; j <= Math.sqrt(iNum); j++) {
          if(iNum % j == 0) {
            pFlag = 1;
            break;
          }
        } int j = 2; int j = 2; j 2 j <= Math.sqrt(iNum) j Math.sqrt(iNum) Math.sqrt Math iNum j++ j++ j {
          if(iNum % j == 0) {
            pFlag = 1;
            break;
          }
        } {
          if(iNum % j == 0) {
            pFlag = 1;
            break;
          }
        } if(iNum % j == 0) {
            pFlag = 1;
            break;
          } iNum % j == 0 iNum % j iNum j 0 {
            pFlag = 1;
            break;
          } pFlag = 1 pFlag 1 break; if(pFlag == 0) {
          result++;
        } pFlag == 0 pFlag 0 {
          result++;
        } result++ result System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      String count = new String(in.readLine());
      int lineCount = Integer.parseInt(count);
      int pFlag = 0;
      int result = 0;
      for(int i = 0; i < lineCount; i++) {
        String num = new String(in.readLine());
        int iNum = Integer.parseInt(num);
        pFlag = 0;
        for(int j = 2; j <= Math.sqrt(iNum); j++) {
          if(iNum % j == 0) {
            pFlag = 1;
            break;
          }
        }
        if(pFlag == 0) {
          result++;
        }
      }
      System.out.println(result);
    } catch(IOException e) {
    }
  }
} public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      String count = new String(in.readLine());
      int lineCount = Integer.parseInt(count);
      int pFlag = 0;
      int result = 0;
      for(int i = 0; i < lineCount; i++) {
        String num = new String(in.readLine());
        int iNum = Integer.parseInt(num);
        pFlag = 0;
        for(int j = 2; j <= Math.sqrt(iNum); j++) {
          if(iNum % j == 0) {
            pFlag = 1;
            break;
          }
        }
        if(pFlag == 0) {
          result++;
        }
      }
      System.out.println(result);
    } catch(IOException e) {
    }
  }
} Main
import java.io.*;

public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      String count = new String(in.readLine());
      int lineCount = Integer.parseInt(count);
      int pFlag = 0;
      int result = 0;
      for(int i = 0; i < lineCount; i++) {
        String num = new String(in.readLine());
        int iNum = Integer.parseInt(num);
        pFlag = 0;
        for(int j = 2; j <= Math.sqrt(iNum); j++) {
          if(iNum % j == 0) {
            pFlag = 1;
            break;
          }
        }
        if(pFlag == 0) {
          result++;
        }
      }
      System.out.println(result);
    } catch(IOException e) {
    }
  }
}