#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define INF 114514810
#define MOD 1000000007
#define ALL(a) begin((a)),end((a))
#define MS(m,v) memset(m,v,sizeof(m))
#define D10  fixed<<setprecision(10)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> P;
typedef long long ll;
struct edge
{
	int from, to, cost;
	bool operator < (const edge& e) const { return cost < e.cost; }
	bool operator >(const edge& e) const { return cost > e.cost; }
};
///*************************************************************************************///
///*************************************************************************************///
///*************************************************************************************///

bool isprime(int n)
{
	for (int i = 2; i*i < n; i++)
	{
		if (n%i == 0) return false;
	}
	return true;
}

int main()
{
	int n;
	while (cin >> n)
	{
		vi v;
		if (isprime(n)) v.push_back(n);
	}
	cout << v.size() << endl;
	return 0;
}