#include <bits/stdc++.h>
using namespace std;
bool IsPrime(int x) {
  if (x == 2 || x == 3 || x == 5 || x == 7) {
    return true;
  } else {
    for (int i = 2; i < 10; i++) {
      int num = x % i;
      if (num == 0) {
        return false;
        break;
      }
    }
    return true;
  }
}
int main() {
  int a = 0;
  int i = 0;
  int n = 0;
  int s = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a;
    if (IsPrime(a) == 1) {
      s++;
    }
  }
  cout << s << endl;
  return 0;
}
