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[] array = new int[n];
      int putnum = 0;
      while(true){
    	  String str = br.readLine();
    	  array[putnum] = Integer.parseInt(str);
    	  if(++putnum == n)break;
      }
      
      System.out.println(String.valueOf(getPrimeNumber(array)));
 
    }catch(Exception e){
      System.out.println(e);
    }
  }
 
  public static int getPrimeNumber(int array[]){
	  int total = 0;
	  for(int i = 0;i < array.length;++i){
		  boolean isPrime = true;
		  if(array[i] % 2 == 0 || array[i] == 1){
			  isPrime = false;
		  }
		  else{
			  for(int j = 3;j <= Math.sqrt(array[i]);j += 2){
			  //for(int j = 3;j < array[i];j += 2){
				if(array[i] % j == 0){
					isPrime = false;
					break;
				}
			}
		  }
		  if(isPrime || array[i] == 2)total++;
	  }
	  return total;
  }
} 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[] array = new int[n];
      int putnum = 0;
      while(true){
    	  String str = br.readLine();
    	  array[putnum] = Integer.parseInt(str);
    	  if(++putnum == n)break;
      }
      
      System.out.println(String.valueOf(getPrimeNumber(array)));
 
    }catch(Exception e){
      System.out.println(e);
    }
  }
 
  public static int getPrimeNumber(int array[]){
	  int total = 0;
	  for(int i = 0;i < array.length;++i){
		  boolean isPrime = true;
		  if(array[i] % 2 == 0 || array[i] == 1){
			  isPrime = false;
		  }
		  else{
			  for(int j = 3;j <= Math.sqrt(array[i]);j += 2){
			  //for(int j = 3;j < array[i];j += 2){
				if(array[i] % j == 0){
					isPrime = false;
					break;
				}
			}
		  }
		  if(isPrime || array[i] == 2)total++;
	  }
	  return total;
  }
} Main public static void main(String[] args)
  {
    try{
    	// ??\???????????????
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      // ????????°???????????????
      int n = Integer.parseInt(br.readLine());
      int[] array = new int[n];
      int putnum = 0;
      while(true){
    	  String str = br.readLine();
    	  array[putnum] = Integer.parseInt(str);
    	  if(++putnum == n)break;
      }
      
      System.out.println(String.valueOf(getPrimeNumber(array)));
 
    }catch(Exception e){
      System.out.println(e);
    }
  } main {
    try{
    	// ??\???????????????
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      // ????????°???????????????
      int n = Integer.parseInt(br.readLine());
      int[] array = new int[n];
      int putnum = 0;
      while(true){
    	  String str = br.readLine();
    	  array[putnum] = Integer.parseInt(str);
    	  if(++putnum == n)break;
      }
      
      System.out.println(String.valueOf(getPrimeNumber(array)));
 
    }catch(Exception e){
      System.out.println(e);
    }
  } try{
    	// ??\???????????????
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      // ????????°???????????????
      int n = Integer.parseInt(br.readLine());
      int[] array = new int[n];
      int putnum = 0;
      while(true){
    	  String str = br.readLine();
    	  array[putnum] = Integer.parseInt(str);
    	  if(++putnum == n)break;
      }
      
      System.out.println(String.valueOf(getPrimeNumber(array)));
 
    }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[] array = new int[n];
      int putnum = 0;
      while(true){
    	  String str = br.readLine();
    	  array[putnum] = Integer.parseInt(str);
    	  if(++putnum == n)break;
      }
      
      System.out.println(String.valueOf(getPrimeNumber(array)));
 
    } 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[] array = new int[n]; array new int[n] n int putnum = 0; putnum 0 while(true){
    	  String str = br.readLine();
    	  array[putnum] = Integer.parseInt(str);
    	  if(++putnum == n)break;
      } true {
    	  String str = br.readLine();
    	  array[putnum] = Integer.parseInt(str);
    	  if(++putnum == n)break;
      } String str = br.readLine(); str br.readLine() br.readLine br array[putnum] = Integer.parseInt(str) array[putnum] array putnum Integer.parseInt(str) Integer.parseInt Integer str if(++putnum == n)break; ++putnum == n ++putnum putnum n break; System.out.println(String.valueOf(getPrimeNumber(array))) System.out.println System.out System System.out String.valueOf(getPrimeNumber(array)) String.valueOf String getPrimeNumber(array) getPrimeNumber array String[] args args public static int getPrimeNumber(int array[]){
	  int total = 0;
	  for(int i = 0;i < array.length;++i){
		  boolean isPrime = true;
		  if(array[i] % 2 == 0 || array[i] == 1){
			  isPrime = false;
		  }
		  else{
			  for(int j = 3;j <= Math.sqrt(array[i]);j += 2){
			  //for(int j = 3;j < array[i];j += 2){
				if(array[i] % j == 0){
					isPrime = false;
					break;
				}
			}
		  }
		  if(isPrime || array[i] == 2)total++;
	  }
	  return total;
  } getPrimeNumber {
	  int total = 0;
	  for(int i = 0;i < array.length;++i){
		  boolean isPrime = true;
		  if(array[i] % 2 == 0 || array[i] == 1){
			  isPrime = false;
		  }
		  else{
			  for(int j = 3;j <= Math.sqrt(array[i]);j += 2){
			  //for(int j = 3;j < array[i];j += 2){
				if(array[i] % j == 0){
					isPrime = false;
					break;
				}
			}
		  }
		  if(isPrime || array[i] == 2)total++;
	  }
	  return total;
  } int total = 0; total 0 for(int i = 0;i < array.length;++i){
		  boolean isPrime = true;
		  if(array[i] % 2 == 0 || array[i] == 1){
			  isPrime = false;
		  }
		  else{
			  for(int j = 3;j <= Math.sqrt(array[i]);j += 2){
			  //for(int j = 3;j < array[i];j += 2){
				if(array[i] % j == 0){
					isPrime = false;
					break;
				}
			}
		  }
		  if(isPrime || array[i] == 2)total++;
	  } int i = 0; int i = 0; i 0 i < array.length i array.length array array.length ++i ++i i {
		  boolean isPrime = true;
		  if(array[i] % 2 == 0 || array[i] == 1){
			  isPrime = false;
		  }
		  else{
			  for(int j = 3;j <= Math.sqrt(array[i]);j += 2){
			  //for(int j = 3;j < array[i];j += 2){
				if(array[i] % j == 0){
					isPrime = false;
					break;
				}
			}
		  }
		  if(isPrime || array[i] == 2)total++;
	  } {
		  boolean isPrime = true;
		  if(array[i] % 2 == 0 || array[i] == 1){
			  isPrime = false;
		  }
		  else{
			  for(int j = 3;j <= Math.sqrt(array[i]);j += 2){
			  //for(int j = 3;j < array[i];j += 2){
				if(array[i] % j == 0){
					isPrime = false;
					break;
				}
			}
		  }
		  if(isPrime || array[i] == 2)total++;
	  } boolean isPrime = true; isPrime true if(array[i] % 2 == 0 || array[i] == 1){
			  isPrime = false;
		  }
		  else{
			  for(int j = 3;j <= Math.sqrt(array[i]);j += 2){
			  //for(int j = 3;j < array[i];j += 2){
				if(array[i] % j == 0){
					isPrime = false;
					break;
				}
			}
		  } array[i] % 2 == 0 || array[i] == 1 array[i] % 2 == 0 array[i] % 2 array[i] array i 2 0 array[i] == 1 array[i] array i 1 {
			  isPrime = false;
		  } isPrime = false isPrime false {
			  for(int j = 3;j <= Math.sqrt(array[i]);j += 2){
			  //for(int j = 3;j < array[i];j += 2){
				if(array[i] % j == 0){
					isPrime = false;
					break;
				}
			}
		  } for(int j = 3;j <= Math.sqrt(array[i]);j += 2){
			  //for(int j = 3;j < array[i];j += 2){
				if(array[i] % j == 0){
					isPrime = false;
					break;
				}
			} int j = 3; int j = 3; j 3 j <= Math.sqrt(array[i]) j Math.sqrt(array[i]) Math.sqrt Math array[i] array i j += 2 j += 2 j 2 {
			  //for(int j = 3;j < array[i];j += 2){
				if(array[i] % j == 0){
					isPrime = false;
					break;
				}
			} {
			  //for(int j = 3;j < array[i];j += 2){
				if(array[i] % j == 0){
					isPrime = false;
					break;
				}
			} if(array[i] % j == 0){
					isPrime = false;
					break;
				} array[i] % j == 0 array[i] % j array[i] array i j 0 {
					isPrime = false;
					break;
				} isPrime = false isPrime false break; if(isPrime || array[i] == 2)total++; isPrime || array[i] == 2 isPrime array[i] == 2 array[i] array i 2 total++ total return total; total int array[] array
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[] array = new int[n];
      int putnum = 0;
      while(true){
    	  String str = br.readLine();
    	  array[putnum] = Integer.parseInt(str);
    	  if(++putnum == n)break;
      }
      
      System.out.println(String.valueOf(getPrimeNumber(array)));
 
    }catch(Exception e){
      System.out.println(e);
    }
  }
 
  public static int getPrimeNumber(int array[]){
	  int total = 0;
	  for(int i = 0;i < array.length;++i){
		  boolean isPrime = true;
		  if(array[i] % 2 == 0 || array[i] == 1){
			  isPrime = false;
		  }
		  else{
			  for(int j = 3;j <= Math.sqrt(array[i]);j += 2){
			  //for(int j = 3;j < array[i];j += 2){
				if(array[i] % j == 0){
					isPrime = false;
					break;
				}
			}
		  }
		  if(isPrime || array[i] == 2)total++;
	  }
	  return total;
  }
}