#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <iomanip>
#include <fstream>
#include <stdint.h>
#include <cmath>
#include <algorithm>
#include <utility>
#include <numeric>
using namespace std;

constexpr int INF       = 1000000000;/* 1e+9a */
constexpr int MODULO    = 1000000007;

constexpr int evx[4] = { 1, 0, -1, 0 };
constexpr int evy[4] = { 0, 1, 0, -1 };

//----------------------------------
//----------------------------------

constexpr int Sup = 100000000;
array<bool, Sup> number;
vector<int> primes;

void era()
{
        for(int i = 0; i < Sup; ++i)
        {
                number[i] = true;
        }

        int prime = 2;
        primes.push_back(2);
        while(true)
        {
                for(int i = 2 * prime; i < Sup; i += prime)
                {
                        number[i] = false;
                }
                int j = prime + 1;
                while(true)
                {
                        if(j >= Sup)
                                return;
                        else
                                if(number[j])
                                {
                                        prime = j;
                                        primes.push_back(prime);
                                        break;
                                }
                        j++;
                }
        }
}

signed main()
{
    ios::sync_with_stdio(false);
        era();
        int n;
        cin >> n;
        int ans = 0;
        for(int i = 0; i < n; ++i)
        {
                int tmp;
                cin >> tmp;
                ans += binary_search(primes.begin(),primes.end(), tmp);

        }
        cout << ans << '\n';


}