#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b[10000] = {0}, B[10000] = {0}, c = 0;
  cin >> a;
  for (int i = 0; i < a; i++) {
    cin >> b[i];
  }
  for (int i = 0; i < a; i++) {
    if (b[i] == 2 || b[i] == 3 || b[i] == 5 || b[i] == 7 || b[i] == 11 ||
        b[i] == 13 || b[i] == 17 || b[i] == 19 || b[i] == 23) {
      continue;
    } else if (b[i] % 2 == 0 || b[i] % 3 == 0 || b[i] % 5 == 0 ||
               b[i] % 7 == 0 || b[i] % 11 == 0 || b[i] % 13 == 0 ||
               b[i] % 17 == 0 || b[i] % 19 == 0 || b[i] % 23 == 0) {
      c++;
    } else {
      for (int j = 13; j < b[i] / 2; j++) {
        if (b[i] % j == 0) {
          c++;
          break;
        } else {
          j++;
        }
      }
    }
  }
  c = a - c;
  cout << c << endl;
  return 0;
}
