#include <bits/stdc++.h>
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
using ll = long long;
using namespace std;
int main() {
  int n;
  vector<int> a;
  int ans = 0;
  cin >> n;
  a.resize(n);
  for (int i = 0; i < (n); ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < (n); ++i) {
    bool f = true;
    for (int j = 2; j * j <= a[i]; ++j) {
      if (a[i] % j == 0) {
        f = false;
      }
    }
    if (f) {
      ++ans;
    }
  }
  cout << ans << endl;
}
