#include <bits/stdc++.h>
using namespace std;
bool NOTP[10001] = {false};
void isprime() {
  int n = (int)sqrt(10001);
  for (int i = 0; i < n + 1; i++) {
    if (i < 2)
      NOTP[i] = true;
    else if (NOTP[i] == false) {
      for (int j = i + 1; j < 10001 + 1; j++) {
        if (NOTP[j] == false && j % i == 0) NOTP[j] = true;
      }
    }
  }
}
void output() {
  for (int i = 0; i < 10001 + 1; i++) {
    cout << i << " " << NOTP[i] << endl;
  }
}
int main() {
  isprime();
  int n, ans = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int m;
    cin >> m;
    if (NOTP[m] == false) ans++;
  }
  cout << ans << endl;
  return 0;
}
