#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, value, i, j, flag, cnt = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> value;
    if (value == 2 || value == 3 || value == 3 || value == 5) cnt++;
    flag = 1;
    if (value % 2 == 0 || value % 3 == 0 || value % 5 == 0) continue;
    for (j = 7; j < value; j += 2) {
      if (value % j == 0) {
        flag = 0;
        break;
      }
    }
    if (flag == 1) cnt++;
  }
  cout << cnt << endl;
  return 0;
}
