#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x;
  int cnt = 0;
  int flag = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    for (int j = 2; j < sqrt(x); j++) {
      if (x % j == 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 0 && x != 4) cnt++;
    flag = 0;
  }
  cout << cnt << endl;
  return 0;
}
