#include<iostream>
#include<cmath>
 
#define size 1000;
 
using namespace std;
 
bool isprime (int x) {
 
    int = i;
 
    if (x == 2) {
 
        return true;
 
    }
 
    if (x < 2 || x % 2 == 0) {
 
        return false;
 
    }
 
    for (i = 3; i * i <= x; i += 2) {
 
        if (n % i == 0) {
 
            return false;
 
        }
 
        return true;
 
    }
 
}
 
int main () {
 
    int n, x;
    int count = 0;
 
    cin >> n;
  
    for (i = 0; i < n; i++) {

        cin >> x;
 
        if (isprime (x)) {
 
            count += 1;
 
        }
 
    }
 
    cout << count << endl;
 
    return 0;
 
}