#include <bits/stdc++.h>
using namespace std;
void save(vector<int> &a, int n) {
  int ceil = sqrt(n);
  a.push_back(2);
  for (int i = 3; i < n; i++) {
    bool frag = false;
    for (int j = 0; j < a.size(); j++) {
      int now = a[j];
      if (i % now == 0) {
        frag = true;
        break;
      }
    }
    if (!frag) {
      a.push_back(i);
    }
  }
}
bool isPrime(int num, vector<int> &prime) {
  vector<int>::iterator it = find(prime.begin(), prime.end(), num);
  return (it != prime.end());
}
int main() {
  vector<int> prime;
  save(prime, 10000);
  int N;
  cin >> N;
  int count = 0;
  for (int i = 0; i < N; i++) {
    int num;
    scanf("%d", &num);
    if (isPrime(num, prime)) {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
