#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[11000], cnt;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n; ++i) {
    bool sosu = true;
    for (int j = 2; j < a[i]; ++j) {
      if (a[i] % j == 0) {
        sosu = false;
        break;
      }
    }
    if (sosu) ++cnt;
  }
  cout << cnt << endl;
  return 0;
}
