import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		
		int flag, num, cnt = 0;
		
		for(int i = 0; i < n; i++) {
			flag = 0;
			
			num = sc.nextInt();
			
			if(num % 2 == 0 && num != 2) {
				flag = 1;
			}
			
			for(int j = 3; j <= Math.sqrt(num) && flag == 0; j+=2) {
				if(num % j == 0) {
					flag = 1;
					break;
				}
			}
			
			if(flag == 0) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		
		int flag, num, cnt = 0;
		
		for(int i = 0; i < n; i++) {
			flag = 0;
			
			num = sc.nextInt();
			
			if(num % 2 == 0 && num != 2) {
				flag = 1;
			}
			
			for(int j = 3; j <= Math.sqrt(num) && flag == 0; j+=2) {
				if(num % j == 0) {
					flag = 1;
					break;
				}
			}
			
			if(flag == 0) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		
		int flag, num, cnt = 0;
		
		for(int i = 0; i < n; i++) {
			flag = 0;
			
			num = sc.nextInt();
			
			if(num % 2 == 0 && num != 2) {
				flag = 1;
			}
			
			for(int j = 3; j <= Math.sqrt(num) && flag == 0; j+=2) {
				if(num % j == 0) {
					flag = 1;
					break;
				}
			}
			
			if(flag == 0) {
				cnt++;
			}
		}
		System.out.println(cnt);
	} main {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		
		int flag, num, cnt = 0;
		
		for(int i = 0; i < n; i++) {
			flag = 0;
			
			num = sc.nextInt();
			
			if(num % 2 == 0 && num != 2) {
				flag = 1;
			}
			
			for(int j = 3; j <= Math.sqrt(num) && flag == 0; j+=2) {
				if(num % j == 0) {
					flag = 1;
					break;
				}
			}
			
			if(flag == 0) {
				cnt++;
			}
		}
		System.out.println(cnt);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int flag flag num num cnt = 0; cnt 0 for(int i = 0; i < n; i++) {
			flag = 0;
			
			num = sc.nextInt();
			
			if(num % 2 == 0 && num != 2) {
				flag = 1;
			}
			
			for(int j = 3; j <= Math.sqrt(num) && flag == 0; j+=2) {
				if(num % j == 0) {
					flag = 1;
					break;
				}
			}
			
			if(flag == 0) {
				cnt++;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			flag = 0;
			
			num = sc.nextInt();
			
			if(num % 2 == 0 && num != 2) {
				flag = 1;
			}
			
			for(int j = 3; j <= Math.sqrt(num) && flag == 0; j+=2) {
				if(num % j == 0) {
					flag = 1;
					break;
				}
			}
			
			if(flag == 0) {
				cnt++;
			}
		} {
			flag = 0;
			
			num = sc.nextInt();
			
			if(num % 2 == 0 && num != 2) {
				flag = 1;
			}
			
			for(int j = 3; j <= Math.sqrt(num) && flag == 0; j+=2) {
				if(num % j == 0) {
					flag = 1;
					break;
				}
			}
			
			if(flag == 0) {
				cnt++;
			}
		} flag = 0 flag 0 num = sc.nextInt() num sc.nextInt() sc.nextInt sc if(num % 2 == 0 && num != 2) {
				flag = 1;
			} num % 2 == 0 && num != 2 num % 2 == 0 num % 2 num 2 0 num != 2 num 2 {
				flag = 1;
			} flag = 1 flag 1 for(int j = 3; j <= Math.sqrt(num) && flag == 0; j+=2) {
				if(num % j == 0) {
					flag = 1;
					break;
				}
			} int j = 3; int j = 3; j 3 j <= Math.sqrt(num) && flag == 0 j <= Math.sqrt(num) j Math.sqrt(num) Math.sqrt Math num flag == 0 flag 0 j+=2 j+=2 j 2 {
				if(num % j == 0) {
					flag = 1;
					break;
				}
			} {
				if(num % j == 0) {
					flag = 1;
					break;
				}
			} if(num % j == 0) {
					flag = 1;
					break;
				} num % j == 0 num % j num j 0 {
					flag = 1;
					break;
				} flag = 1 flag 1 break; if(flag == 0) {
				cnt++;
			} flag == 0 flag 0 {
				cnt++;
			} cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		
		int flag, num, cnt = 0;
		
		for(int i = 0; i < n; i++) {
			flag = 0;
			
			num = sc.nextInt();
			
			if(num % 2 == 0 && num != 2) {
				flag = 1;
			}
			
			for(int j = 3; j <= Math.sqrt(num) && flag == 0; j+=2) {
				if(num % j == 0) {
					flag = 1;
					break;
				}
			}
			
			if(flag == 0) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		
		int flag, num, cnt = 0;
		
		for(int i = 0; i < n; i++) {
			flag = 0;
			
			num = sc.nextInt();
			
			if(num % 2 == 0 && num != 2) {
				flag = 1;
			}
			
			for(int j = 3; j <= Math.sqrt(num) && flag == 0; j+=2) {
				if(num % j == 0) {
					flag = 1;
					break;
				}
			}
			
			if(flag == 0) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		
		int flag, num, cnt = 0;
		
		for(int i = 0; i < n; i++) {
			flag = 0;
			
			num = sc.nextInt();
			
			if(num % 2 == 0 && num != 2) {
				flag = 1;
			}
			
			for(int j = 3; j <= Math.sqrt(num) && flag == 0; j+=2) {
				if(num % j == 0) {
					flag = 1;
					break;
				}
			}
			
			if(flag == 0) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
}