#include <iostream>
using namespace std;
bool prim(int n)
{
if (n <= 1)
{
return false;
}
else if (n != 2 && n % 2 == 0)
{
return false;
}
for (int i = 3; i * i <= n; i += 2)
{
if (n % i == 0)
{
return false;
}
}
return true;
}
int main()
{
int n, cnt = 0;
cin >> n;
for (int i = 1; i <= n; ++i)
{
int x;
cin >> x;
if (prim(x))
{
cnt++;
}
}
cout << cnt;
return 0;
}