#include <iostream>
#include <math.h>

int main() {
	int n, x, y = 0;
	std::cin >> n;
	while (n != 0 && std::cin >> x) {
		n--; x == 2 ? y++ : 0;
		if (x % 2 != 0) {
			int  _ = 0;
			for (int num = 3, k = sqrt(x) + 1; num < k && _ == 0; num++)
				x % num == 0 ? _++ : 0; 
			_ == 0 ? y++ : 0;
		}
	}
	std::cout << y << "\n";
	return 0;
}
