import java.util.Scanner;

class Main {
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int  num = scanner.nextInt();//要素数
		int count = 0;
		int prime_num = 0;
		boolean prime = false;
		
		while( count < num ) {
			prime = isPrime(scanner);
			if( prime ) {
				prime_num ++;
			}
			count ++;
		}

		 System.out.println(prime_num);
		
		scanner.close();
	}

	public static boolean isPrime(Scanner scanner) {
		int  num = scanner.nextInt();//要素数
		
	    if (num == 2) return true;
	    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く
	
	    double sqrtNum = Math.sqrt(num);
	    for (int i = 3; i <= sqrtNum; i += 2)
	    {
	        if (num % i == 0)
	        {
	            // 素数ではない
	            return false;
	        }
	    }
	
	    // 素数である
	    return true;
	}
} import java.util.Scanner; Scanner java.util class Main {
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int  num = scanner.nextInt();//要素数
		int count = 0;
		int prime_num = 0;
		boolean prime = false;
		
		while( count < num ) {
			prime = isPrime(scanner);
			if( prime ) {
				prime_num ++;
			}
			count ++;
		}

		 System.out.println(prime_num);
		
		scanner.close();
	}

	public static boolean isPrime(Scanner scanner) {
		int  num = scanner.nextInt();//要素数
		
	    if (num == 2) return true;
	    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く
	
	    double sqrtNum = Math.sqrt(num);
	    for (int i = 3; i <= sqrtNum; i += 2)
	    {
	        if (num % i == 0)
	        {
	            // 素数ではない
	            return false;
	        }
	    }
	
	    // 素数である
	    return true;
	}
} Main public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int  num = scanner.nextInt();//要素数
		int count = 0;
		int prime_num = 0;
		boolean prime = false;
		
		while( count < num ) {
			prime = isPrime(scanner);
			if( prime ) {
				prime_num ++;
			}
			count ++;
		}

		 System.out.println(prime_num);
		
		scanner.close();
	} main {
		Scanner scanner = new Scanner(System.in);
		int  num = scanner.nextInt();//要素数
		int count = 0;
		int prime_num = 0;
		boolean prime = false;
		
		while( count < num ) {
			prime = isPrime(scanner);
			if( prime ) {
				prime_num ++;
			}
			count ++;
		}

		 System.out.println(prime_num);
		
		scanner.close();
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int  num = scanner.nextInt(); num scanner.nextInt() scanner.nextInt scanner int count = 0; count 0 int prime_num = 0; prime_num 0 boolean prime = false; prime false while( count < num ) {
			prime = isPrime(scanner);
			if( prime ) {
				prime_num ++;
			}
			count ++;
		} count < num count num {
			prime = isPrime(scanner);
			if( prime ) {
				prime_num ++;
			}
			count ++;
		} prime = isPrime(scanner) prime isPrime(scanner) isPrime scanner if( prime ) {
				prime_num ++;
			} prime {
				prime_num ++;
			} prime_num ++ prime_num count ++ count System.out.println(prime_num) System.out.println System.out System System.out prime_num scanner.close() scanner.close scanner String args[] args public static boolean isPrime(Scanner scanner) {
		int  num = scanner.nextInt();//要素数
		
	    if (num == 2) return true;
	    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く
	
	    double sqrtNum = Math.sqrt(num);
	    for (int i = 3; i <= sqrtNum; i += 2)
	    {
	        if (num % i == 0)
	        {
	            // 素数ではない
	            return false;
	        }
	    }
	
	    // 素数である
	    return true;
	} isPrime {
		int  num = scanner.nextInt();//要素数
		
	    if (num == 2) return true;
	    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く
	
	    double sqrtNum = Math.sqrt(num);
	    for (int i = 3; i <= sqrtNum; i += 2)
	    {
	        if (num % i == 0)
	        {
	            // 素数ではない
	            return false;
	        }
	    }
	
	    // 素数である
	    return true;
	} int  num = scanner.nextInt(); num scanner.nextInt() scanner.nextInt scanner if (num == 2) return true;
	    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く num == 2 num 2 return true; true if (num % 2 == 0) return false; // 偶数はあらかじめ除く num % 2 == 0 num % 2 num 2 0 return false; // 偶数はあらかじめ除く false double sqrtNum = Math.sqrt(num); sqrtNum Math.sqrt(num) Math.sqrt Math num for (int i = 3; i <= sqrtNum; i += 2)
	    {
	        if (num % i == 0)
	        {
	            // 素数ではない
	            return false;
	        }
	    } int i = 3; int i = 3; i 3 i <= sqrtNum i sqrtNum i += 2 i += 2 i 2 {
	        if (num % i == 0)
	        {
	            // 素数ではない
	            return false;
	        }
	    } {
	        if (num % i == 0)
	        {
	            // 素数ではない
	            return false;
	        }
	    } if (num % i == 0)
	        {
	            // 素数ではない
	            return false;
	        } num % i == 0 num % i num i 0 {
	            // 素数ではない
	            return false;
	        } return false; false return true; true Scanner scanner scanner
import java.util.Scanner;

class Main {
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int  num = scanner.nextInt();//要素数
		int count = 0;
		int prime_num = 0;
		boolean prime = false;
		
		while( count < num ) {
			prime = isPrime(scanner);
			if( prime ) {
				prime_num ++;
			}
			count ++;
		}

		 System.out.println(prime_num);
		
		scanner.close();
	}

	public static boolean isPrime(Scanner scanner) {
		int  num = scanner.nextInt();//要素数
		
	    if (num == 2) return true;
	    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く
	
	    double sqrtNum = Math.sqrt(num);
	    for (int i = 3; i <= sqrtNum; i += 2)
	    {
	        if (num % i == 0)
	        {
	            // 素数ではない
	            return false;
	        }
	    }
	
	    // 素数である
	    return true;
	}
}
