#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int pcnt = 0;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    bool isprime = true;
    if (x > 2 and x % 2 == 0) {
      isprime = false;
    }
    for (int j = 3; j < x / 3 + 1 and isprime != false; j += 2) {
      if (x % j == 0) {
        isprime = false;
        break;
      }
    }
    if (isprime == true) {
      pcnt += 1;
    }
  }
  cout << pcnt << endl;
  return 0;
}
