#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int in;
    cin >> in;
    int limit = sqrt(in);
    for (int j = 2; j < limit; j++) {
      if (in % j == 0) {
        ans++;
        break;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
