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

public class Main {
	public static void main(String[] args) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			final int n = Integer.parseInt(reader.readLine());
			final int[] list = new int[n];
			for (int i = 0; i < n; i++) {
				list[i] = Integer.parseInt(reader.readLine());
			}
			reader.close();
			
			int count = 0;
			for (int num : list) {
				if (isPrime(num)) count++;
			}
			
			System.out.println(String.valueOf(count));
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
	
	public static boolean isPrime(final int num) {
		boolean isPrime;
		
		if (num < 2) {
			isPrime = false;
			
		} else if (num == 2) {
			isPrime = true;
			
		} else if (num % 2 == 0) { 
			isPrime = false;
			
		} else {
			isPrime = true;
			
			final int end = (int)Math.pow(num, 0.5);
			for (int i = 3; i <= end; i += 2) {
				if (num % i == 0) {
					isPrime = false;
					break;
				}
			}
		}
		return isPrime;
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			final int n = Integer.parseInt(reader.readLine());
			final int[] list = new int[n];
			for (int i = 0; i < n; i++) {
				list[i] = Integer.parseInt(reader.readLine());
			}
			reader.close();
			
			int count = 0;
			for (int num : list) {
				if (isPrime(num)) count++;
			}
			
			System.out.println(String.valueOf(count));
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
	
	public static boolean isPrime(final int num) {
		boolean isPrime;
		
		if (num < 2) {
			isPrime = false;
			
		} else if (num == 2) {
			isPrime = true;
			
		} else if (num % 2 == 0) { 
			isPrime = false;
			
		} else {
			isPrime = true;
			
			final int end = (int)Math.pow(num, 0.5);
			for (int i = 3; i <= end; i += 2) {
				if (num % i == 0) {
					isPrime = false;
					break;
				}
			}
		}
		return isPrime;
	}
} Main public static void main(String[] args) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			final int n = Integer.parseInt(reader.readLine());
			final int[] list = new int[n];
			for (int i = 0; i < n; i++) {
				list[i] = Integer.parseInt(reader.readLine());
			}
			reader.close();
			
			int count = 0;
			for (int num : list) {
				if (isPrime(num)) count++;
			}
			
			System.out.println(String.valueOf(count));
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	} main {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			final int n = Integer.parseInt(reader.readLine());
			final int[] list = new int[n];
			for (int i = 0; i < n; i++) {
				list[i] = Integer.parseInt(reader.readLine());
			}
			reader.close();
			
			int count = 0;
			for (int num : list) {
				if (isPrime(num)) count++;
			}
			
			System.out.println(String.valueOf(count));
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	} try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			final int n = Integer.parseInt(reader.readLine());
			final int[] list = new int[n];
			for (int i = 0; i < n; i++) {
				list[i] = Integer.parseInt(reader.readLine());
			}
			reader.close();
			
			int count = 0;
			for (int num : list) {
				if (isPrime(num)) count++;
			}
			
			System.out.println(String.valueOf(count));
		} catch (Exception e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		} Exception e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			final int n = Integer.parseInt(reader.readLine());
			final int[] list = new int[n];
			for (int i = 0; i < n; i++) {
				list[i] = Integer.parseInt(reader.readLine());
			}
			reader.close();
			
			int count = 0;
			for (int num : list) {
				if (isPrime(num)) count++;
			}
			
			System.out.println(String.valueOf(count));
		} BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) final int n = Integer.parseInt(reader.readLine()); n Integer.parseInt(reader.readLine()) Integer.parseInt Integer reader.readLine() reader.readLine reader final int[] list = new int[n]; list new int[n] n for (int i = 0; i < n; i++) {
				list[i] = Integer.parseInt(reader.readLine());
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				list[i] = Integer.parseInt(reader.readLine());
			} {
				list[i] = Integer.parseInt(reader.readLine());
			} list[i] = Integer.parseInt(reader.readLine()) list[i] list i Integer.parseInt(reader.readLine()) Integer.parseInt Integer reader.readLine() reader.readLine reader reader.close() reader.close reader int count = 0; count 0 for (int num : list) {
				if (isPrime(num)) count++;
			} int num list {
				if (isPrime(num)) count++;
			} {
				if (isPrime(num)) count++;
			} if (isPrime(num)) count++; isPrime(num) isPrime num count++ count System.out.println(String.valueOf(count)) System.out.println System.out System System.out String.valueOf(count) String.valueOf String count String[] args args public static boolean isPrime(final int num) {
		boolean isPrime;
		
		if (num < 2) {
			isPrime = false;
			
		} else if (num == 2) {
			isPrime = true;
			
		} else if (num % 2 == 0) { 
			isPrime = false;
			
		} else {
			isPrime = true;
			
			final int end = (int)Math.pow(num, 0.5);
			for (int i = 3; i <= end; i += 2) {
				if (num % i == 0) {
					isPrime = false;
					break;
				}
			}
		}
		return isPrime;
	} isPrime {
		boolean isPrime;
		
		if (num < 2) {
			isPrime = false;
			
		} else if (num == 2) {
			isPrime = true;
			
		} else if (num % 2 == 0) { 
			isPrime = false;
			
		} else {
			isPrime = true;
			
			final int end = (int)Math.pow(num, 0.5);
			for (int i = 3; i <= end; i += 2) {
				if (num % i == 0) {
					isPrime = false;
					break;
				}
			}
		}
		return isPrime;
	} boolean isPrime; isPrime if (num < 2) {
			isPrime = false;
			
		} else if (num == 2) {
			isPrime = true;
			
		} else if (num % 2 == 0) { 
			isPrime = false;
			
		} else {
			isPrime = true;
			
			final int end = (int)Math.pow(num, 0.5);
			for (int i = 3; i <= end; i += 2) {
				if (num % i == 0) {
					isPrime = false;
					break;
				}
			}
		} num < 2 num 2 {
			isPrime = false;
			
		} isPrime = false isPrime false if (num == 2) {
			isPrime = true;
			
		} else if (num % 2 == 0) { 
			isPrime = false;
			
		} else {
			isPrime = true;
			
			final int end = (int)Math.pow(num, 0.5);
			for (int i = 3; i <= end; i += 2) {
				if (num % i == 0) {
					isPrime = false;
					break;
				}
			}
		} num == 2 num 2 {
			isPrime = true;
			
		} isPrime = true isPrime true if (num % 2 == 0) { 
			isPrime = false;
			
		} else {
			isPrime = true;
			
			final int end = (int)Math.pow(num, 0.5);
			for (int i = 3; i <= end; i += 2) {
				if (num % i == 0) {
					isPrime = false;
					break;
				}
			}
		} num % 2 == 0 num % 2 num 2 0 { 
			isPrime = false;
			
		} isPrime = false isPrime false {
			isPrime = true;
			
			final int end = (int)Math.pow(num, 0.5);
			for (int i = 3; i <= end; i += 2) {
				if (num % i == 0) {
					isPrime = false;
					break;
				}
			}
		} isPrime = true isPrime true final int end = (int)Math.pow(num, 0.5); end (int)Math.pow(num, 0.5) Math.pow Math num 0.5 for (int i = 3; i <= end; i += 2) {
				if (num % i == 0) {
					isPrime = false;
					break;
				}
			} int i = 3; int i = 3; i 3 i <= end i end i += 2 i += 2 i 2 {
				if (num % i == 0) {
					isPrime = false;
					break;
				}
			} {
				if (num % i == 0) {
					isPrime = false;
					break;
				}
			} if (num % i == 0) {
					isPrime = false;
					break;
				} num % i == 0 num % i num i 0 {
					isPrime = false;
					break;
				} isPrime = false isPrime false break; return isPrime; isPrime final int num num public class Main {
	public static void main(String[] args) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			final int n = Integer.parseInt(reader.readLine());
			final int[] list = new int[n];
			for (int i = 0; i < n; i++) {
				list[i] = Integer.parseInt(reader.readLine());
			}
			reader.close();
			
			int count = 0;
			for (int num : list) {
				if (isPrime(num)) count++;
			}
			
			System.out.println(String.valueOf(count));
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
	
	public static boolean isPrime(final int num) {
		boolean isPrime;
		
		if (num < 2) {
			isPrime = false;
			
		} else if (num == 2) {
			isPrime = true;
			
		} else if (num % 2 == 0) { 
			isPrime = false;
			
		} else {
			isPrime = true;
			
			final int end = (int)Math.pow(num, 0.5);
			for (int i = 3; i <= end; i += 2) {
				if (num % i == 0) {
					isPrime = false;
					break;
				}
			}
		}
		return isPrime;
	}
} public class Main {
	public static void main(String[] args) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			final int n = Integer.parseInt(reader.readLine());
			final int[] list = new int[n];
			for (int i = 0; i < n; i++) {
				list[i] = Integer.parseInt(reader.readLine());
			}
			reader.close();
			
			int count = 0;
			for (int num : list) {
				if (isPrime(num)) count++;
			}
			
			System.out.println(String.valueOf(count));
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
	
	public static boolean isPrime(final int num) {
		boolean isPrime;
		
		if (num < 2) {
			isPrime = false;
			
		} else if (num == 2) {
			isPrime = true;
			
		} else if (num % 2 == 0) { 
			isPrime = false;
			
		} else {
			isPrime = true;
			
			final int end = (int)Math.pow(num, 0.5);
			for (int i = 3; i <= end; i += 2) {
				if (num % i == 0) {
					isPrime = false;
					break;
				}
			}
		}
		return isPrime;
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			final int n = Integer.parseInt(reader.readLine());
			final int[] list = new int[n];
			for (int i = 0; i < n; i++) {
				list[i] = Integer.parseInt(reader.readLine());
			}
			reader.close();
			
			int count = 0;
			for (int num : list) {
				if (isPrime(num)) count++;
			}
			
			System.out.println(String.valueOf(count));
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
	
	public static boolean isPrime(final int num) {
		boolean isPrime;
		
		if (num < 2) {
			isPrime = false;
			
		} else if (num == 2) {
			isPrime = true;
			
		} else if (num % 2 == 0) { 
			isPrime = false;
			
		} else {
			isPrime = true;
			
			final int end = (int)Math.pow(num, 0.5);
			for (int i = 3; i <= end; i += 2) {
				if (num % i == 0) {
					isPrime = false;
					break;
				}
			}
		}
		return isPrime;
	}
}