#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, ans = 0;
  vector<int> a;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    a.push_back(x);
  }
  for (int i = 0; i < n; i++) {
    if (a[i] == 2) {
      ans++;
      continue;
    }
    if (a[i] <= 1) continue;
    if (a[i] % 2 == 0) continue;
    int k = 3;
    while (k <= static_cast<int>(pow(a[i], 0.5))) {
      if (a[i] % k == k) {
        ans--;
        break;
      }
      k += 2;
    }
    ans++;
  }
  cout << ans << endl;
  return 0;
}
