#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, a, b, count, c, w;
  double d;
  n = 0;
  b = 0;
  cin >> n;
  count = 0;
  for (a = 0; a < n; a++) {
    cin >> b;
    d = b;
    for (w = 0; w <= 0; w++) {
      if (b == 2) {
        break;
      }
      if (b % 2 == 0 || b == 1) {
        count++;
        break;
      }
      for (c = 3; sqrt(d) > c; c = c + 2) {
        if (b % c == 0) {
          count++;
          break;
        }
      }
    }
  }
  cout << n - count << endl;
  return 0;
}
