#include <bits/stdc++.h>
using namespace std;
const int MAX = 100000000 + 1;
class primer {
  bool *isprime;

 public:
  primer();
  ~primer();
  bool isPrime(int number) { return isprime[number]; };
};
primer::primer() {
  isprime = new bool[MAX];
  isprime[0] = false;
  isprime[1] = false;
  for (int i = 2; i < MAX; i++) {
    isprime[i] = true;
  }
  for (int i = 2; i < sqrt(MAX); i++) {
    if (isprime[i]) {
      for (int j = 2; i * j < MAX; j++) {
        isprime[i * j] = false;
      }
    }
  }
}
primer::~primer() { delete[] isprime; }
int main(int argc, char const *argv[]) {
  int count;
  cin >> count;
  int prime_count = 0;
  primer p;
  for (int i = 0; i < count; i++) {
    int number;
    cin >> number;
    if (p.isPrime(number)) {
      prime_count++;
    }
  }
  cout << prime_count << endl;
  return 0;
}
