import java.util.Scanner;
/**
 * @author saiyo
 *
 */
public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		//int x = scan.nextInt();
		//int y = scan.nextInt();
		
		//Seisu s = new Seisu(x, y);
		//s.kouyaku();

		int con = scan.nextInt();
		
		int[] num = new int[con];
		for(int i = 0; i < con; i++){
			num[i] = scan.nextInt();
		}
		Seisu s = new Seisu(num);
		s.countSosu();
		/*
		Sort s = new Sort(num);
		s.printSort();
		s.insertionSort();
		*/
	}

}

class Seisu{
	private int x, y;
	private int snum[];
	
	Seisu(int x, int y){
		if(x >= y){
			this.x = x;
			this.y = y;
		}else{
			this.x = y;
			this.y = x;
		}
		
	}
	
	Seisu(int snum[]){
		this.snum = new int[snum.length];
		for(int i = 0; i < snum.length; i++){
			this.snum[i] = snum[i];
		}
	}
	
	public void countSosu(){
		int con = 0;
		for(int nu: this.snum){
			con += isSosu(nu);
		}
		System.out.println(con);
	}
	
	public int isSosu(int num){
		for(int i = 2; i < Math.sqrt(num) + 1; i++){

			if(num % i == 0 && num != 2){
				return 0;
			}
			
		}
		return 1;
	}
	
	public void kouyaku(){
		System.out.println(modSeisu(this.x, this.y));
	}
	
	
	public int modSeisu(int x, int y){
		if(x % y == 0){
			return y;
		}else{
			return modSeisu(y , x % y);
		}
	}
}

class Sort{
	private int[] sorted;
	
	Sort(int[] sorted){
		this.sorted = new int[sorted.length];
		for(int i = 0; i < sorted.length; i++){
			this.sorted[i] = sorted[i];
		}
	}
	
	public void insertionSort(){
		int v, j;
		for(int i = 1; i < this.sorted.length; i++){
			v = this.sorted[i];
			j = i - 1;
			while(j >= 0 && this.sorted[j] > v){
				this.sorted[j + 1] = this.sorted[j];
				j--;
			}
			this.sorted[j + 1] = v;
			printSort();
		}
	}
	
	public void printSort(){
		for(int i  = 0; i < this.sorted.length - 1; i++){
			System.out.print(this.sorted[i] + " ");
		}
		System.out.println(this.sorted[this.sorted.length - 1]);
	}
}
 import java.util.Scanner; Scanner java.util public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		//int x = scan.nextInt();
		//int y = scan.nextInt();
		
		//Seisu s = new Seisu(x, y);
		//s.kouyaku();

		int con = scan.nextInt();
		
		int[] num = new int[con];
		for(int i = 0; i < con; i++){
			num[i] = scan.nextInt();
		}
		Seisu s = new Seisu(num);
		s.countSosu();
		/*
		Sort s = new Sort(num);
		s.printSort();
		s.insertionSort();
		*/
	}

} Main /**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		//int x = scan.nextInt();
		//int y = scan.nextInt();
		
		//Seisu s = new Seisu(x, y);
		//s.kouyaku();

		int con = scan.nextInt();
		
		int[] num = new int[con];
		for(int i = 0; i < con; i++){
			num[i] = scan.nextInt();
		}
		Seisu s = new Seisu(num);
		s.countSosu();
		/*
		Sort s = new Sort(num);
		s.printSort();
		s.insertionSort();
		*/
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		//int x = scan.nextInt();
		//int y = scan.nextInt();
		
		//Seisu s = new Seisu(x, y);
		//s.kouyaku();

		int con = scan.nextInt();
		
		int[] num = new int[con];
		for(int i = 0; i < con; i++){
			num[i] = scan.nextInt();
		}
		Seisu s = new Seisu(num);
		s.countSosu();
		/*
		Sort s = new Sort(num);
		s.printSort();
		s.insertionSort();
		*/
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int con = scan.nextInt(); con scan.nextInt() scan.nextInt scan int[] num = new int[con]; num new int[con] con for(int i = 0; i < con; i++){
			num[i] = scan.nextInt();
		} int i = 0; int i = 0; i 0 i < con i con i++ i++ i {
			num[i] = scan.nextInt();
		} {
			num[i] = scan.nextInt();
		} num[i] = scan.nextInt() num[i] num i scan.nextInt() scan.nextInt scan Seisu s = new Seisu(num); s new Seisu(num) s.countSosu() s.countSosu s String[] args args class Seisu{
	private int x, y;
	private int snum[];
	
	Seisu(int x, int y){
		if(x >= y){
			this.x = x;
			this.y = y;
		}else{
			this.x = y;
			this.y = x;
		}
		
	}
	
	Seisu(int snum[]){
		this.snum = new int[snum.length];
		for(int i = 0; i < snum.length; i++){
			this.snum[i] = snum[i];
		}
	}
	
	public void countSosu(){
		int con = 0;
		for(int nu: this.snum){
			con += isSosu(nu);
		}
		System.out.println(con);
	}
	
	public int isSosu(int num){
		for(int i = 2; i < Math.sqrt(num) + 1; i++){

			if(num % i == 0 && num != 2){
				return 0;
			}
			
		}
		return 1;
	}
	
	public void kouyaku(){
		System.out.println(modSeisu(this.x, this.y));
	}
	
	
	public int modSeisu(int x, int y){
		if(x % y == 0){
			return y;
		}else{
			return modSeisu(y , x % y);
		}
	}
} Seisu private int x x y; y private int snum[]; snum Seisu(int x, int y){
		if(x >= y){
			this.x = x;
			this.y = y;
		}else{
			this.x = y;
			this.y = x;
		}
		
	} Seisu {
		if(x >= y){
			this.x = x;
			this.y = y;
		}else{
			this.x = y;
			this.y = x;
		}
		
	} if(x >= y){
			this.x = x;
			this.y = y;
		}else{
			this.x = y;
			this.y = x;
		} x >= y x y {
			this.x = x;
			this.y = y;
		} this.x = x this.x this this.x x this.y = y this.y this this.y y {
			this.x = y;
			this.y = x;
		} this.x = y this.x this this.x y this.y = x this.y this this.y x int x x int y y Seisu(int snum[]){
		this.snum = new int[snum.length];
		for(int i = 0; i < snum.length; i++){
			this.snum[i] = snum[i];
		}
	} Seisu {
		this.snum = new int[snum.length];
		for(int i = 0; i < snum.length; i++){
			this.snum[i] = snum[i];
		}
	} this.snum = new int[snum.length] this.snum this this.snum new int[snum.length] snum.length snum snum.length for(int i = 0; i < snum.length; i++){
			this.snum[i] = snum[i];
		} int i = 0; int i = 0; i 0 i < snum.length i snum.length snum snum.length i++ i++ i {
			this.snum[i] = snum[i];
		} {
			this.snum[i] = snum[i];
		} this.snum[i] = snum[i] this.snum[i] this.snum this this.snum i snum[i] snum i int snum[] snum public void countSosu(){
		int con = 0;
		for(int nu: this.snum){
			con += isSosu(nu);
		}
		System.out.println(con);
	} countSosu {
		int con = 0;
		for(int nu: this.snum){
			con += isSosu(nu);
		}
		System.out.println(con);
	} int con = 0; con 0 for(int nu: this.snum){
			con += isSosu(nu);
		} int nu this.snum this this.snum {
			con += isSosu(nu);
		} {
			con += isSosu(nu);
		} con += isSosu(nu) con isSosu(nu) isSosu nu System.out.println(con) System.out.println System.out System System.out con public int isSosu(int num){
		for(int i = 2; i < Math.sqrt(num) + 1; i++){

			if(num % i == 0 && num != 2){
				return 0;
			}
			
		}
		return 1;
	} isSosu {
		for(int i = 2; i < Math.sqrt(num) + 1; i++){

			if(num % i == 0 && num != 2){
				return 0;
			}
			
		}
		return 1;
	} for(int i = 2; i < Math.sqrt(num) + 1; i++){

			if(num % i == 0 && num != 2){
				return 0;
			}
			
		} int i = 2; int i = 2; i 2 i < Math.sqrt(num) + 1 i Math.sqrt(num) + 1 Math.sqrt(num) Math.sqrt Math num 1 i++ i++ i {

			if(num % i == 0 && num != 2){
				return 0;
			}
			
		} {

			if(num % i == 0 && num != 2){
				return 0;
			}
			
		} if(num % i == 0 && num != 2){
				return 0;
			} num % i == 0 && num != 2 num % i == 0 num % i num i 0 num != 2 num 2 {
				return 0;
			} return 0; 0 return 1; 1 int num num public void kouyaku(){
		System.out.println(modSeisu(this.x, this.y));
	} kouyaku {
		System.out.println(modSeisu(this.x, this.y));
	} System.out.println(modSeisu(this.x, this.y)) System.out.println System.out System System.out modSeisu(this.x, this.y) modSeisu this.x this this.x this.y this this.y public int modSeisu(int x, int y){
		if(x % y == 0){
			return y;
		}else{
			return modSeisu(y , x % y);
		}
	} modSeisu {
		if(x % y == 0){
			return y;
		}else{
			return modSeisu(y , x % y);
		}
	} if(x % y == 0){
			return y;
		}else{
			return modSeisu(y , x % y);
		} x % y == 0 x % y x y 0 {
			return y;
		} return y; y {
			return modSeisu(y , x % y);
		} return modSeisu(y , x % y); modSeisu(y , x % y) modSeisu y x % y x y int x x int y y class Sort{
	private int[] sorted;
	
	Sort(int[] sorted){
		this.sorted = new int[sorted.length];
		for(int i = 0; i < sorted.length; i++){
			this.sorted[i] = sorted[i];
		}
	}
	
	public void insertionSort(){
		int v, j;
		for(int i = 1; i < this.sorted.length; i++){
			v = this.sorted[i];
			j = i - 1;
			while(j >= 0 && this.sorted[j] > v){
				this.sorted[j + 1] = this.sorted[j];
				j--;
			}
			this.sorted[j + 1] = v;
			printSort();
		}
	}
	
	public void printSort(){
		for(int i  = 0; i < this.sorted.length - 1; i++){
			System.out.print(this.sorted[i] + " ");
		}
		System.out.println(this.sorted[this.sorted.length - 1]);
	}
} Sort private int[] sorted; sorted Sort(int[] sorted){
		this.sorted = new int[sorted.length];
		for(int i = 0; i < sorted.length; i++){
			this.sorted[i] = sorted[i];
		}
	} Sort {
		this.sorted = new int[sorted.length];
		for(int i = 0; i < sorted.length; i++){
			this.sorted[i] = sorted[i];
		}
	} this.sorted = new int[sorted.length] this.sorted this this.sorted new int[sorted.length] sorted.length sorted sorted.length for(int i = 0; i < sorted.length; i++){
			this.sorted[i] = sorted[i];
		} int i = 0; int i = 0; i 0 i < sorted.length i sorted.length sorted sorted.length i++ i++ i {
			this.sorted[i] = sorted[i];
		} {
			this.sorted[i] = sorted[i];
		} this.sorted[i] = sorted[i] this.sorted[i] this.sorted this this.sorted i sorted[i] sorted i int[] sorted sorted public void insertionSort(){
		int v, j;
		for(int i = 1; i < this.sorted.length; i++){
			v = this.sorted[i];
			j = i - 1;
			while(j >= 0 && this.sorted[j] > v){
				this.sorted[j + 1] = this.sorted[j];
				j--;
			}
			this.sorted[j + 1] = v;
			printSort();
		}
	} insertionSort {
		int v, j;
		for(int i = 1; i < this.sorted.length; i++){
			v = this.sorted[i];
			j = i - 1;
			while(j >= 0 && this.sorted[j] > v){
				this.sorted[j + 1] = this.sorted[j];
				j--;
			}
			this.sorted[j + 1] = v;
			printSort();
		}
	} int v v j; j for(int i = 1; i < this.sorted.length; i++){
			v = this.sorted[i];
			j = i - 1;
			while(j >= 0 && this.sorted[j] > v){
				this.sorted[j + 1] = this.sorted[j];
				j--;
			}
			this.sorted[j + 1] = v;
			printSort();
		} int i = 1; int i = 1; i 1 i < this.sorted.length i this.sorted.length this.sorted this this.sorted this.sorted.length i++ i++ i {
			v = this.sorted[i];
			j = i - 1;
			while(j >= 0 && this.sorted[j] > v){
				this.sorted[j + 1] = this.sorted[j];
				j--;
			}
			this.sorted[j + 1] = v;
			printSort();
		} {
			v = this.sorted[i];
			j = i - 1;
			while(j >= 0 && this.sorted[j] > v){
				this.sorted[j + 1] = this.sorted[j];
				j--;
			}
			this.sorted[j + 1] = v;
			printSort();
		} v = this.sorted[i] v this.sorted[i] this.sorted this this.sorted i j = i - 1 j i - 1 i 1 while(j >= 0 && this.sorted[j] > v){
				this.sorted[j + 1] = this.sorted[j];
				j--;
			} j >= 0 && this.sorted[j] > v j >= 0 j 0 this.sorted[j] > v this.sorted[j] this.sorted this this.sorted j v {
				this.sorted[j + 1] = this.sorted[j];
				j--;
			} this.sorted[j + 1] = this.sorted[j] this.sorted[j + 1] this.sorted this this.sorted j + 1 j 1 this.sorted[j] this.sorted this this.sorted j j-- j this.sorted[j + 1] = v this.sorted[j + 1] this.sorted this this.sorted j + 1 j 1 v printSort() printSort public void printSort(){
		for(int i  = 0; i < this.sorted.length - 1; i++){
			System.out.print(this.sorted[i] + " ");
		}
		System.out.println(this.sorted[this.sorted.length - 1]);
	} printSort {
		for(int i  = 0; i < this.sorted.length - 1; i++){
			System.out.print(this.sorted[i] + " ");
		}
		System.out.println(this.sorted[this.sorted.length - 1]);
	} for(int i  = 0; i < this.sorted.length - 1; i++){
			System.out.print(this.sorted[i] + " ");
		} int i  = 0; int i  = 0; i 0 i < this.sorted.length - 1 i this.sorted.length - 1 this.sorted.length this.sorted this this.sorted this.sorted.length 1 i++ i++ i {
			System.out.print(this.sorted[i] + " ");
		} {
			System.out.print(this.sorted[i] + " ");
		} System.out.print(this.sorted[i] + " ") System.out.print System.out System System.out this.sorted[i] + " " this.sorted[i] this.sorted this this.sorted i " " System.out.println(this.sorted[this.sorted.length - 1]) System.out.println System.out System System.out this.sorted[this.sorted.length - 1] this.sorted this this.sorted this.sorted.length - 1 this.sorted.length this.sorted this this.sorted this.sorted.length 1 public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		//int x = scan.nextInt();
		//int y = scan.nextInt();
		
		//Seisu s = new Seisu(x, y);
		//s.kouyaku();

		int con = scan.nextInt();
		
		int[] num = new int[con];
		for(int i = 0; i < con; i++){
			num[i] = scan.nextInt();
		}
		Seisu s = new Seisu(num);
		s.countSosu();
		/*
		Sort s = new Sort(num);
		s.printSort();
		s.insertionSort();
		*/
	}

} public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		//int x = scan.nextInt();
		//int y = scan.nextInt();
		
		//Seisu s = new Seisu(x, y);
		//s.kouyaku();

		int con = scan.nextInt();
		
		int[] num = new int[con];
		for(int i = 0; i < con; i++){
			num[i] = scan.nextInt();
		}
		Seisu s = new Seisu(num);
		s.countSosu();
		/*
		Sort s = new Sort(num);
		s.printSort();
		s.insertionSort();
		*/
	}

} Main
import java.util.Scanner;
/**
 * @author saiyo
 *
 */
public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		//int x = scan.nextInt();
		//int y = scan.nextInt();
		
		//Seisu s = new Seisu(x, y);
		//s.kouyaku();

		int con = scan.nextInt();
		
		int[] num = new int[con];
		for(int i = 0; i < con; i++){
			num[i] = scan.nextInt();
		}
		Seisu s = new Seisu(num);
		s.countSosu();
		/*
		Sort s = new Sort(num);
		s.printSort();
		s.insertionSort();
		*/
	}

}

class Seisu{
	private int x, y;
	private int snum[];
	
	Seisu(int x, int y){
		if(x >= y){
			this.x = x;
			this.y = y;
		}else{
			this.x = y;
			this.y = x;
		}
		
	}
	
	Seisu(int snum[]){
		this.snum = new int[snum.length];
		for(int i = 0; i < snum.length; i++){
			this.snum[i] = snum[i];
		}
	}
	
	public void countSosu(){
		int con = 0;
		for(int nu: this.snum){
			con += isSosu(nu);
		}
		System.out.println(con);
	}
	
	public int isSosu(int num){
		for(int i = 2; i < Math.sqrt(num) + 1; i++){

			if(num % i == 0 && num != 2){
				return 0;
			}
			
		}
		return 1;
	}
	
	public void kouyaku(){
		System.out.println(modSeisu(this.x, this.y));
	}
	
	
	public int modSeisu(int x, int y){
		if(x % y == 0){
			return y;
		}else{
			return modSeisu(y , x % y);
		}
	}
}

class Sort{
	private int[] sorted;
	
	Sort(int[] sorted){
		this.sorted = new int[sorted.length];
		for(int i = 0; i < sorted.length; i++){
			this.sorted[i] = sorted[i];
		}
	}
	
	public void insertionSort(){
		int v, j;
		for(int i = 1; i < this.sorted.length; i++){
			v = this.sorted[i];
			j = i - 1;
			while(j >= 0 && this.sorted[j] > v){
				this.sorted[j + 1] = this.sorted[j];
				j--;
			}
			this.sorted[j + 1] = v;
			printSort();
		}
	}
	
	public void printSort(){
		for(int i  = 0; i < this.sorted.length - 1; i++){
			System.out.print(this.sorted[i] + " ");
		}
		System.out.println(this.sorted[this.sorted.length - 1]);
	}
}

