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