import java.util.Scanner;

public class Main {
	static boolean is_prime(int n) {
	    if (n <= 3) {
	        return n > 1;
	    }
	    if (n % 6 != 1 && n % 6 != 5) {
	        return false;
	    }
	    int sqrt = (int) Math.sqrt(n);
	    for (int i = 5; i <= sqrt; i += 6) {
	        if (n % i == 0 || n % (i + 2) == 0) {
	            return false;
	        }
	    }
	    return true;
	    }
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count=0;
		int x[] = new int[n];
		while(n-1>=0) {
			x[count] = sc.nextInt();
			count++;
			n--;

		}
		count = 0;
		for(int i=0;i<x.length;i++) {
			if(is_prime(x[i])) {
				count++;
				}
			}
		System.out.println(count);
		sc.close();
		}

	}

 import java.util.Scanner; Scanner java.util public class Main {
	static boolean is_prime(int n) {
	    if (n <= 3) {
	        return n > 1;
	    }
	    if (n % 6 != 1 && n % 6 != 5) {
	        return false;
	    }
	    int sqrt = (int) Math.sqrt(n);
	    for (int i = 5; i <= sqrt; i += 6) {
	        if (n % i == 0 || n % (i + 2) == 0) {
	            return false;
	        }
	    }
	    return true;
	    }
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count=0;
		int x[] = new int[n];
		while(n-1>=0) {
			x[count] = sc.nextInt();
			count++;
			n--;

		}
		count = 0;
		for(int i=0;i<x.length;i++) {
			if(is_prime(x[i])) {
				count++;
				}
			}
		System.out.println(count);
		sc.close();
		}

	} Main static boolean is_prime(int n) {
	    if (n <= 3) {
	        return n > 1;
	    }
	    if (n % 6 != 1 && n % 6 != 5) {
	        return false;
	    }
	    int sqrt = (int) Math.sqrt(n);
	    for (int i = 5; i <= sqrt; i += 6) {
	        if (n % i == 0 || n % (i + 2) == 0) {
	            return false;
	        }
	    }
	    return true;
	    } is_prime {
	    if (n <= 3) {
	        return n > 1;
	    }
	    if (n % 6 != 1 && n % 6 != 5) {
	        return false;
	    }
	    int sqrt = (int) Math.sqrt(n);
	    for (int i = 5; i <= sqrt; i += 6) {
	        if (n % i == 0 || n % (i + 2) == 0) {
	            return false;
	        }
	    }
	    return true;
	    } if (n <= 3) {
	        return n > 1;
	    } n <= 3 n 3 {
	        return n > 1;
	    } return n > 1; n > 1 n 1 if (n % 6 != 1 && n % 6 != 5) {
	        return false;
	    } n % 6 != 1 && n % 6 != 5 n % 6 != 1 n % 6 n 6 1 n % 6 != 5 n % 6 n 6 5 {
	        return false;
	    } return false; false int sqrt = (int) Math.sqrt(n); sqrt (int) Math.sqrt(n) Math.sqrt Math n for (int i = 5; i <= sqrt; i += 6) {
	        if (n % i == 0 || n % (i + 2) == 0) {
	            return false;
	        }
	    } int i = 5; int i = 5; i 5 i <= sqrt i sqrt i += 6 i += 6 i 6 {
	        if (n % i == 0 || n % (i + 2) == 0) {
	            return false;
	        }
	    } {
	        if (n % i == 0 || n % (i + 2) == 0) {
	            return false;
	        }
	    } if (n % i == 0 || n % (i + 2) == 0) {
	            return false;
	        } n % i == 0 || n % (i + 2) == 0 n % i == 0 n % i n i 0 n % (i + 2) == 0 n % (i + 2) n (i + 2) i 2 0 {
	            return false;
	        } return false; false return true; true int n n public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count=0;
		int x[] = new int[n];
		while(n-1>=0) {
			x[count] = sc.nextInt();
			count++;
			n--;

		}
		count = 0;
		for(int i=0;i<x.length;i++) {
			if(is_prime(x[i])) {
				count++;
				}
			}
		System.out.println(count);
		sc.close();
		} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count=0;
		int x[] = new int[n];
		while(n-1>=0) {
			x[count] = sc.nextInt();
			count++;
			n--;

		}
		count = 0;
		for(int i=0;i<x.length;i++) {
			if(is_prime(x[i])) {
				count++;
				}
			}
		System.out.println(count);
		sc.close();
		} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int count=0; count 0 int x[] = new int[n]; x new int[n] n while(n-1>=0) {
			x[count] = sc.nextInt();
			count++;
			n--;

		} n-1>=0 n-1 n 1 0 {
			x[count] = sc.nextInt();
			count++;
			n--;

		} x[count] = sc.nextInt() x[count] x count sc.nextInt() sc.nextInt sc count++ count n-- n count = 0 count 0 for(int i=0;i<x.length;i++) {
			if(is_prime(x[i])) {
				count++;
				}
			} int i=0; int i=0; i 0 i<x.length i x.length x x.length i++ i++ i {
			if(is_prime(x[i])) {
				count++;
				}
			} {
			if(is_prime(x[i])) {
				count++;
				}
			} if(is_prime(x[i])) {
				count++;
				} is_prime(x[i]) is_prime x[i] x i {
				count++;
				} count++ count System.out.println(count) System.out.println System.out System System.out count sc.close() sc.close sc String[] args args public class Main {
	static boolean is_prime(int n) {
	    if (n <= 3) {
	        return n > 1;
	    }
	    if (n % 6 != 1 && n % 6 != 5) {
	        return false;
	    }
	    int sqrt = (int) Math.sqrt(n);
	    for (int i = 5; i <= sqrt; i += 6) {
	        if (n % i == 0 || n % (i + 2) == 0) {
	            return false;
	        }
	    }
	    return true;
	    }
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count=0;
		int x[] = new int[n];
		while(n-1>=0) {
			x[count] = sc.nextInt();
			count++;
			n--;

		}
		count = 0;
		for(int i=0;i<x.length;i++) {
			if(is_prime(x[i])) {
				count++;
				}
			}
		System.out.println(count);
		sc.close();
		}

	} public class Main {
	static boolean is_prime(int n) {
	    if (n <= 3) {
	        return n > 1;
	    }
	    if (n % 6 != 1 && n % 6 != 5) {
	        return false;
	    }
	    int sqrt = (int) Math.sqrt(n);
	    for (int i = 5; i <= sqrt; i += 6) {
	        if (n % i == 0 || n % (i + 2) == 0) {
	            return false;
	        }
	    }
	    return true;
	    }
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count=0;
		int x[] = new int[n];
		while(n-1>=0) {
			x[count] = sc.nextInt();
			count++;
			n--;

		}
		count = 0;
		for(int i=0;i<x.length;i++) {
			if(is_prime(x[i])) {
				count++;
				}
			}
		System.out.println(count);
		sc.close();
		}

	} Main
import java.util.Scanner;

public class Main {
	static boolean is_prime(int n) {
	    if (n <= 3) {
	        return n > 1;
	    }
	    if (n % 6 != 1 && n % 6 != 5) {
	        return false;
	    }
	    int sqrt = (int) Math.sqrt(n);
	    for (int i = 5; i <= sqrt; i += 6) {
	        if (n % i == 0 || n % (i + 2) == 0) {
	            return false;
	        }
	    }
	    return true;
	    }
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count=0;
		int x[] = new int[n];
		while(n-1>=0) {
			x[count] = sc.nextInt();
			count++;
			n--;

		}
		count = 0;
		for(int i=0;i<x.length;i++) {
			if(is_prime(x[i])) {
				count++;
				}
			}
		System.out.println(count);
		sc.close();
		}

	}


