import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	private static int prime(int a){
		if(a==2||a==3)return 1;
		for(int i=2;i<Math.sqrt(a)+1;i++){
			if(a%i==0){
				return 0;
			}
		}
		return 1;
	}
	
	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int n=0,j=0,store=0;
            boolean first=true;
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		store+=prime(Integer.parseInt(line));
            		j++;
            		if(j==n){
            			break;
            		}
            	}           	
            }
            System.out.println(store);
        }
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	private static int prime(int a){
		if(a==2||a==3)return 1;
		for(int i=2;i<Math.sqrt(a)+1;i++){
			if(a%i==0){
				return 0;
			}
		}
		return 1;
	}
	
	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int n=0,j=0,store=0;
            boolean first=true;
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		store+=prime(Integer.parseInt(line));
            		j++;
            		if(j==n){
            			break;
            		}
            	}           	
            }
            System.out.println(store);
        }
	}

} Main private static int prime(int a){
		if(a==2||a==3)return 1;
		for(int i=2;i<Math.sqrt(a)+1;i++){
			if(a%i==0){
				return 0;
			}
		}
		return 1;
	} prime {
		if(a==2||a==3)return 1;
		for(int i=2;i<Math.sqrt(a)+1;i++){
			if(a%i==0){
				return 0;
			}
		}
		return 1;
	} if(a==2||a==3)return 1; a==2||a==3 a==2 a 2 a==3 a 3 return 1; 1 for(int i=2;i<Math.sqrt(a)+1;i++){
			if(a%i==0){
				return 0;
			}
		} int i=2; int i=2; i 2 i<Math.sqrt(a)+1 i Math.sqrt(a)+1 Math.sqrt(a) Math.sqrt Math a 1 i++ i++ i {
			if(a%i==0){
				return 0;
			}
		} {
			if(a%i==0){
				return 0;
			}
		} if(a%i==0){
				return 0;
			} a%i==0 a%i a i 0 {
				return 0;
			} return 0; 0 return 1; 1 int a a public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int n=0,j=0,store=0;
            boolean first=true;
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		store+=prime(Integer.parseInt(line));
            		j++;
            		if(j==n){
            			break;
            		}
            	}           	
            }
            System.out.println(store);
        }
	} main {
        // TODO ?????????????????????????????????????????????
        
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int n=0,j=0,store=0;
            boolean first=true;
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		store+=prime(Integer.parseInt(line));
            		j++;
            		if(j==n){
            			break;
            		}
            	}           	
            }
            System.out.println(store);
        }
	} try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int n=0,j=0,store=0;
            boolean first=true;
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		store+=prime(Integer.parseInt(line));
            		j++;
            		if(j==n){
            			break;
            		}
            	}           	
            }
            System.out.println(store);
        } {
            String line;
            int n=0,j=0,store=0;
            boolean first=true;
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		store+=prime(Integer.parseInt(line));
            		j++;
            		if(j==n){
            			break;
            		}
            	}           	
            }
            System.out.println(store);
        } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) String line; line int n=0 n 0 j=0 j 0 store=0; store 0 boolean first=true; first true while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		store+=prime(Integer.parseInt(line));
            		j++;
            		if(j==n){
            			break;
            		}
            	}           	
            } (line = br.readLine()) != null (line = br.readLine()) line br.readLine() br.readLine br null {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		store+=prime(Integer.parseInt(line));
            		j++;
            		if(j==n){
            			break;
            		}
            	}           	
            } if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		store+=prime(Integer.parseInt(line));
            		j++;
            		if(j==n){
            			break;
            		}
            	} first {
            		n=Integer.parseInt(line);
            		first=false;
            	} n=Integer.parseInt(line) n Integer.parseInt(line) Integer.parseInt Integer line first=false first false {
            		store+=prime(Integer.parseInt(line));
            		j++;
            		if(j==n){
            			break;
            		}
            	} store+=prime(Integer.parseInt(line)) store prime(Integer.parseInt(line)) prime Integer.parseInt(line) Integer.parseInt Integer line j++ j if(j==n){
            			break;
            		} j==n j n {
            			break;
            		} break; System.out.println(store) System.out.println System.out System System.out store String[] args args public class Main {
	private static int prime(int a){
		if(a==2||a==3)return 1;
		for(int i=2;i<Math.sqrt(a)+1;i++){
			if(a%i==0){
				return 0;
			}
		}
		return 1;
	}
	
	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int n=0,j=0,store=0;
            boolean first=true;
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		store+=prime(Integer.parseInt(line));
            		j++;
            		if(j==n){
            			break;
            		}
            	}           	
            }
            System.out.println(store);
        }
	}

} public class Main {
	private static int prime(int a){
		if(a==2||a==3)return 1;
		for(int i=2;i<Math.sqrt(a)+1;i++){
			if(a%i==0){
				return 0;
			}
		}
		return 1;
	}
	
	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int n=0,j=0,store=0;
            boolean first=true;
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		store+=prime(Integer.parseInt(line));
            		j++;
            		if(j==n){
            			break;
            		}
            	}           	
            }
            System.out.println(store);
        }
	}

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	private static int prime(int a){
		if(a==2||a==3)return 1;
		for(int i=2;i<Math.sqrt(a)+1;i++){
			if(a%i==0){
				return 0;
			}
		}
		return 1;
	}
	
	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int n=0,j=0,store=0;
            boolean first=true;
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		store+=prime(Integer.parseInt(line));
            		j++;
            		if(j==n){
            			break;
            		}
            	}           	
            }
            System.out.println(store);
        }
	}

}