import java.util.Scanner;
public class Main {
	int n;
	int list[];
	boolean sieve[];
	public static void main(String main[]) {
		new Main();
	}
	Main() {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		list = new int[n];
		int max = 0;
		for (int i = 0; i < n; i++) {
			list [i] = scan.nextInt();
			max = Math.max(max, list[i]);
		}
		sieve = new boolean[max + 1];
		int sqMax = (int)Math.round(Math.sqrt(max));
		for (int i = 2; i <= sqMax; i++) {
			if (sieve[i])continue;
			int j = 2;
			while (i * j < max + 1) {
				sieve[i * j] = true;
				j++;
			}
		}
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			if (!sieve[list[i]]) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
}


/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz