import java.io.*;
import java.util.*;
import java.lang.*;

class Main{
  public static void main(String[] args) throws IOException{
    Scanner scan=new Scanner(System.in);
    int n=Integer.parseInt(scan.next());
    int[] numbers=new int[n];
    for(int i=0;i<numbers.length;i++){
      numbers[i]=Integer.parseInt(scan.next());
    }

    int count=0;
    for(int i=0;i<numbers.length;i++){
      if(numbers[i]==2){
        count++;
        continue;
      }else if(numbers[i]<2 || numbers[i]%2==0){
        continue;
      }
      int j=3;
      while(j<=Math.sqrt(numbers[i])){
        if(numbers[i]%j==0){
          break;
        }
        j+=2;
      }
      if(j>Math.sqrt(numbers[i])){
        count++;
      }
    }
    System.out.println(count);
  }
} import java.io.*; io.* java import java.util.*; util.* java import java.lang.*; lang.* java class Main{
  public static void main(String[] args) throws IOException{
    Scanner scan=new Scanner(System.in);
    int n=Integer.parseInt(scan.next());
    int[] numbers=new int[n];
    for(int i=0;i<numbers.length;i++){
      numbers[i]=Integer.parseInt(scan.next());
    }

    int count=0;
    for(int i=0;i<numbers.length;i++){
      if(numbers[i]==2){
        count++;
        continue;
      }else if(numbers[i]<2 || numbers[i]%2==0){
        continue;
      }
      int j=3;
      while(j<=Math.sqrt(numbers[i])){
        if(numbers[i]%j==0){
          break;
        }
        j+=2;
      }
      if(j>Math.sqrt(numbers[i])){
        count++;
      }
    }
    System.out.println(count);
  }
} Main public static void main(String[] args) throws IOException{
    Scanner scan=new Scanner(System.in);
    int n=Integer.parseInt(scan.next());
    int[] numbers=new int[n];
    for(int i=0;i<numbers.length;i++){
      numbers[i]=Integer.parseInt(scan.next());
    }

    int count=0;
    for(int i=0;i<numbers.length;i++){
      if(numbers[i]==2){
        count++;
        continue;
      }else if(numbers[i]<2 || numbers[i]%2==0){
        continue;
      }
      int j=3;
      while(j<=Math.sqrt(numbers[i])){
        if(numbers[i]%j==0){
          break;
        }
        j+=2;
      }
      if(j>Math.sqrt(numbers[i])){
        count++;
      }
    }
    System.out.println(count);
  } main {
    Scanner scan=new Scanner(System.in);
    int n=Integer.parseInt(scan.next());
    int[] numbers=new int[n];
    for(int i=0;i<numbers.length;i++){
      numbers[i]=Integer.parseInt(scan.next());
    }

    int count=0;
    for(int i=0;i<numbers.length;i++){
      if(numbers[i]==2){
        count++;
        continue;
      }else if(numbers[i]<2 || numbers[i]%2==0){
        continue;
      }
      int j=3;
      while(j<=Math.sqrt(numbers[i])){
        if(numbers[i]%j==0){
          break;
        }
        j+=2;
      }
      if(j>Math.sqrt(numbers[i])){
        count++;
      }
    }
    System.out.println(count);
  } Scanner scan=new Scanner(System.in); scan new Scanner(System.in) int n=Integer.parseInt(scan.next()); n Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan int[] numbers=new int[n]; numbers new int[n] n for(int i=0;i<numbers.length;i++){
      numbers[i]=Integer.parseInt(scan.next());
    } int i=0; int i=0; i 0 i<numbers.length i numbers.length numbers numbers.length i++ i++ i {
      numbers[i]=Integer.parseInt(scan.next());
    } {
      numbers[i]=Integer.parseInt(scan.next());
    } numbers[i]=Integer.parseInt(scan.next()) numbers[i] numbers i Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan int count=0; count 0 for(int i=0;i<numbers.length;i++){
      if(numbers[i]==2){
        count++;
        continue;
      }else if(numbers[i]<2 || numbers[i]%2==0){
        continue;
      }
      int j=3;
      while(j<=Math.sqrt(numbers[i])){
        if(numbers[i]%j==0){
          break;
        }
        j+=2;
      }
      if(j>Math.sqrt(numbers[i])){
        count++;
      }
    } int i=0; int i=0; i 0 i<numbers.length i numbers.length numbers numbers.length i++ i++ i {
      if(numbers[i]==2){
        count++;
        continue;
      }else if(numbers[i]<2 || numbers[i]%2==0){
        continue;
      }
      int j=3;
      while(j<=Math.sqrt(numbers[i])){
        if(numbers[i]%j==0){
          break;
        }
        j+=2;
      }
      if(j>Math.sqrt(numbers[i])){
        count++;
      }
    } {
      if(numbers[i]==2){
        count++;
        continue;
      }else if(numbers[i]<2 || numbers[i]%2==0){
        continue;
      }
      int j=3;
      while(j<=Math.sqrt(numbers[i])){
        if(numbers[i]%j==0){
          break;
        }
        j+=2;
      }
      if(j>Math.sqrt(numbers[i])){
        count++;
      }
    } if(numbers[i]==2){
        count++;
        continue;
      }else if(numbers[i]<2 || numbers[i]%2==0){
        continue;
      } numbers[i]==2 numbers[i] numbers i 2 {
        count++;
        continue;
      } count++ count continue; if(numbers[i]<2 || numbers[i]%2==0){
        continue;
      } numbers[i]<2 || numbers[i]%2==0 numbers[i]<2 numbers[i] numbers i 2 numbers[i]%2==0 numbers[i]%2 numbers[i] numbers i 2 0 {
        continue;
      } continue; int j=3; j 3 while(j<=Math.sqrt(numbers[i])){
        if(numbers[i]%j==0){
          break;
        }
        j+=2;
      } j<=Math.sqrt(numbers[i]) j Math.sqrt(numbers[i]) Math.sqrt Math numbers[i] numbers i {
        if(numbers[i]%j==0){
          break;
        }
        j+=2;
      } if(numbers[i]%j==0){
          break;
        } numbers[i]%j==0 numbers[i]%j numbers[i] numbers i j 0 {
          break;
        } break; j+=2 j 2 if(j>Math.sqrt(numbers[i])){
        count++;
      } j>Math.sqrt(numbers[i]) j Math.sqrt(numbers[i]) Math.sqrt Math numbers[i] numbers i {
        count++;
      } count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args
import java.io.*;
import java.util.*;
import java.lang.*;

class Main{
  public static void main(String[] args) throws IOException{
    Scanner scan=new Scanner(System.in);
    int n=Integer.parseInt(scan.next());
    int[] numbers=new int[n];
    for(int i=0;i<numbers.length;i++){
      numbers[i]=Integer.parseInt(scan.next());
    }

    int count=0;
    for(int i=0;i<numbers.length;i++){
      if(numbers[i]==2){
        count++;
        continue;
      }else if(numbers[i]<2 || numbers[i]%2==0){
        continue;
      }
      int j=3;
      while(j<=Math.sqrt(numbers[i])){
        if(numbers[i]%j==0){
          break;
        }
        j+=2;
      }
      if(j>Math.sqrt(numbers[i])){
        count++;
      }
    }
    System.out.println(count);
  }
}
