#include <bits/stdc++.h>
using namespace std;
void Erarosthenes(vector<int> num, int N) {
  vector<bool> prime_number(1e6, false);
  for (int(i) = (2); (i) < (1e6); (i)++) prime_number[i] = true;
  for (int(i) = (2); (i) < (1e3); (i)++) {
    if (prime_number[i]) {
      for (int j = 2; i * j < 1e6; j++) {
        prime_number[i * j] = false;
      }
    }
  }
  int ans = 0;
  for (int(i) = (0); (i) < (N); (i)++) {
    if (prime_number[num[i]]) ans++;
  }
  cout << (ans) << "\n";
}
int main() {
  int N;
  cin >> N;
  vector<int> num(N);
  for (int(i) = (0); (i) < (N); (i)++) cin >> num[i];
  Erarosthenes(num, N);
}
