#include <bits/stdc++.h>

using namespace std;

int main() {

	int n;
	cin >> n;
	
	int x;
	int counter = 0;
	for (int i = 0; i < n; i++) {
		cin >> x;
		int ccounter = 0;
		for (int j = 1; j <= int(sqrt(x)); j++) {
			if (x%j == 0) { ccounter++;  }
		}
		if (ccounter == 1) { counter++; }
	}
	cout << counter << endl;
}
