#include <bits/stdc++.h>
using namespace std;
template <class X>
void print(X Target) {
  cout << Target << '\n';
}
const int MAX = 1e07;
signed main() {
  ios::sync_with_stdio(false);
  static bool prime[MAX + 1] = {true, true};
  for (int i = 2; i <= MAX; i++) {
    if (!prime[i]) {
      for (int j = i + i; j <= MAX; j += i) {
        prime[j] = true;
      }
    }
  }
  int n, cnt = 0;
  cin >> n;
  while (n--) {
    int num;
    cin >> num;
    if (!prime[num]) {
      cnt++;
    }
  }
  print(cnt);
  return (0);
}
