#include<bits/stdc++.h>
using namespace std;

template<size_t max_N, size_t prime_size>
struct Prime{
    bool sieve[max_N];
    int_fast64_t prime[prime_size];
    size_t counter = 0;
    constexpr Prime() : sieve(), prime() {
        for(int_fast64_t i = 0; i < max_N; ++i)
            sieve[i] = true;
        sieve[0] = sieve[1] = false;
        for(int_fast64_t i = 2; i < max_N; ++i){
            if(sieve[i]){
                prime[counter] = i;
                ++counter;
                if(counter > prime_size)break;
            }
            for(int_fast64_t j = i * i; j < max_N; j += i)
                sieve[j] = false;
        }
    }
    constexpr int_fast64_t operator[](size_t i) const {
        return prime[i];
    }
    constexpr bool operator()(size_t i) const {
        return sieve[i];
    }
};

constexpr size_t n = 200000;
constexpr auto p = Prime<n, 17984>();
uint_fast64_t N, a;

int main(){
    scanf("%lld", &N);
    for(;~scanf("%lld", &a);){
        if(a < n){
            N -= !p(a);
            continue;
        }
        for(size_t i; p[i] * p[i] <= a; ++i){
            if(!(a % p[i])){
                --N;
                break;
            }
        }
    }
    cout << N << endl;
    return 0;
}
