#include <bits/stdc++.h>
using namespace std;
bool prime[10009];
inline void prime_sifter(int);
int main() {
  memset(prime, true, sizeof(prime));
  int n, count = 0, x;
  cin >> n;
  prime_sifter(10009);
  for (int i = 1; i <= n; ++i) {
    cin >> x;
    if (x <= 1) continue;
    if (prime[x]) ++count;
  }
  cout << count << endl;
  return 0;
}
inline void prime_sifter(int n) {
  for (int i = 2; i <= n; ++i) {
    if (prime[i]) {
      for (int j = i + i; j <= n; j += i) {
        prime[j] = false;
      }
    }
  }
}
