using namespace std;

void InsertionSort(int a[], int n) {
	for (int i = 0; i < n; i++) {
		int v = a[i];
		int j = i - 1;
		while (j >= 0 && a[j] > v) {
			a[j + 1] = a[j];
			j--;
		}
		a[j + 1] = v;
		for (int i = 0; i < n-1; i++) {
			cout << a[i] << ' ';
		}
		cout << a[n - 1] << endl;
	}
}

int GCD(int x, int y) {
	if (x%y == 0) return y;
	else {
		return GCD(y, x%y);
	}
}

bool PrimeNumber(int p) {
	if (p == 2) return true;
	if (p < 2 || p % 2 == 0) return false;

	int i = 3;
	while (i <= sqrt((double)p)) {
		if (p%i == 0) {
			return false;
		}
		i = i + 2;
	}
	return true;
}

int main() {
	int n;
	int a[10000];
	int count = 0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	for (int i = 0; i < n; i++) {
		if (PrimeNumber(a[i])) count++;
	}
	cout << count << endl;
	
}