import java.util.Scanner;

class Main{
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] arr = new int[n];
		for(int i=0; i<n; i++) {
			arr[i] = scan.nextInt();
		}
		int k = 2;
		int flag = 1; //0???????´???°??§????????????1???????´???°
		int cnt = 0; //?´???°?????°???????????????
		for(int i=0; i<arr.length; i++){
			while(k <= Math.sqrt(arr[i])+1){
			//while(arr[i] != k){
			//wh1ile(list.hasnext()){
				//System.out.println("arr[i]:" + arr[i] + ",k:" + k + ",??????:" + arr[i] % k);
				if(arr[i] % k == 0 && arr[i] != 2){
					flag = 0;
					break;
				}
				k++;
			}
			if(flag == 1){cnt++;}
			flag = 1;
			k = 2;
		}
		System.out.println(cnt);
	}
} import java.util.Scanner; Scanner java.util class Main{
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] arr = new int[n];
		for(int i=0; i<n; i++) {
			arr[i] = scan.nextInt();
		}
		int k = 2;
		int flag = 1; //0???????´???°??§????????????1???????´???°
		int cnt = 0; //?´???°?????°???????????????
		for(int i=0; i<arr.length; i++){
			while(k <= Math.sqrt(arr[i])+1){
			//while(arr[i] != k){
			//wh1ile(list.hasnext()){
				//System.out.println("arr[i]:" + arr[i] + ",k:" + k + ",??????:" + arr[i] % k);
				if(arr[i] % k == 0 && arr[i] != 2){
					flag = 0;
					break;
				}
				k++;
			}
			if(flag == 1){cnt++;}
			flag = 1;
			k = 2;
		}
		System.out.println(cnt);
	}
} Main public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] arr = new int[n];
		for(int i=0; i<n; i++) {
			arr[i] = scan.nextInt();
		}
		int k = 2;
		int flag = 1; //0???????´???°??§????????????1???????´???°
		int cnt = 0; //?´???°?????°???????????????
		for(int i=0; i<arr.length; i++){
			while(k <= Math.sqrt(arr[i])+1){
			//while(arr[i] != k){
			//wh1ile(list.hasnext()){
				//System.out.println("arr[i]:" + arr[i] + ",k:" + k + ",??????:" + arr[i] % k);
				if(arr[i] % k == 0 && arr[i] != 2){
					flag = 0;
					break;
				}
				k++;
			}
			if(flag == 1){cnt++;}
			flag = 1;
			k = 2;
		}
		System.out.println(cnt);
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] arr = new int[n];
		for(int i=0; i<n; i++) {
			arr[i] = scan.nextInt();
		}
		int k = 2;
		int flag = 1; //0???????´???°??§????????????1???????´???°
		int cnt = 0; //?´???°?????°???????????????
		for(int i=0; i<arr.length; i++){
			while(k <= Math.sqrt(arr[i])+1){
			//while(arr[i] != k){
			//wh1ile(list.hasnext()){
				//System.out.println("arr[i]:" + arr[i] + ",k:" + k + ",??????:" + arr[i] % k);
				if(arr[i] % k == 0 && arr[i] != 2){
					flag = 0;
					break;
				}
				k++;
			}
			if(flag == 1){cnt++;}
			flag = 1;
			k = 2;
		}
		System.out.println(cnt);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int[] arr = new int[n]; arr new int[n] n for(int i=0; i<n; i++) {
			arr[i] = scan.nextInt();
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			arr[i] = scan.nextInt();
		} {
			arr[i] = scan.nextInt();
		} arr[i] = scan.nextInt() arr[i] arr i scan.nextInt() scan.nextInt scan int k = 2; k 2 int flag = 1; flag 1 int cnt = 0; cnt 0 for(int i=0; i<arr.length; i++){
			while(k <= Math.sqrt(arr[i])+1){
			//while(arr[i] != k){
			//wh1ile(list.hasnext()){
				//System.out.println("arr[i]:" + arr[i] + ",k:" + k + ",??????:" + arr[i] % k);
				if(arr[i] % k == 0 && arr[i] != 2){
					flag = 0;
					break;
				}
				k++;
			}
			if(flag == 1){cnt++;}
			flag = 1;
			k = 2;
		} int i=0; int i=0; i 0 i<arr.length i arr.length arr arr.length i++ i++ i {
			while(k <= Math.sqrt(arr[i])+1){
			//while(arr[i] != k){
			//wh1ile(list.hasnext()){
				//System.out.println("arr[i]:" + arr[i] + ",k:" + k + ",??????:" + arr[i] % k);
				if(arr[i] % k == 0 && arr[i] != 2){
					flag = 0;
					break;
				}
				k++;
			}
			if(flag == 1){cnt++;}
			flag = 1;
			k = 2;
		} {
			while(k <= Math.sqrt(arr[i])+1){
			//while(arr[i] != k){
			//wh1ile(list.hasnext()){
				//System.out.println("arr[i]:" + arr[i] + ",k:" + k + ",??????:" + arr[i] % k);
				if(arr[i] % k == 0 && arr[i] != 2){
					flag = 0;
					break;
				}
				k++;
			}
			if(flag == 1){cnt++;}
			flag = 1;
			k = 2;
		} while(k <= Math.sqrt(arr[i])+1){
			//while(arr[i] != k){
			//wh1ile(list.hasnext()){
				//System.out.println("arr[i]:" + arr[i] + ",k:" + k + ",??????:" + arr[i] % k);
				if(arr[i] % k == 0 && arr[i] != 2){
					flag = 0;
					break;
				}
				k++;
			} k <= Math.sqrt(arr[i])+1 k Math.sqrt(arr[i])+1 Math.sqrt(arr[i]) Math.sqrt Math arr[i] arr i 1 {
			//while(arr[i] != k){
			//wh1ile(list.hasnext()){
				//System.out.println("arr[i]:" + arr[i] + ",k:" + k + ",??????:" + arr[i] % k);
				if(arr[i] % k == 0 && arr[i] != 2){
					flag = 0;
					break;
				}
				k++;
			} if(arr[i] % k == 0 && arr[i] != 2){
					flag = 0;
					break;
				} arr[i] % k == 0 && arr[i] != 2 arr[i] % k == 0 arr[i] % k arr[i] arr i k 0 arr[i] != 2 arr[i] arr i 2 {
					flag = 0;
					break;
				} flag = 0 flag 0 break; k++ k if(flag == 1){cnt++;} flag == 1 flag 1 {cnt++;} cnt++ cnt flag = 1 flag 1 k = 2 k 2 System.out.println(cnt) System.out.println System.out System System.out cnt String args[] args
import java.util.Scanner;

class Main{
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] arr = new int[n];
		for(int i=0; i<n; i++) {
			arr[i] = scan.nextInt();
		}
		int k = 2;
		int flag = 1; //0???????´???°??§????????????1???????´???°
		int cnt = 0; //?´???°?????°???????????????
		for(int i=0; i<arr.length; i++){
			while(k <= Math.sqrt(arr[i])+1){
			//while(arr[i] != k){
			//wh1ile(list.hasnext()){
				//System.out.println("arr[i]:" + arr[i] + ",k:" + k + ",??????:" + arr[i] % k);
				if(arr[i] % k == 0 && arr[i] != 2){
					flag = 0;
					break;
				}
				k++;
			}
			if(flag == 1){cnt++;}
			flag = 1;
			k = 2;
		}
		System.out.println(cnt);
	}
}