#include <bits/stdc++.h>
using namespace std;
string prime(int a) {
  for (int j = 0; j < sqrt(a); j++) {
    if (a % j == 0) {
      return "no";
    }
  }
  return "yes";
}
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (prime(a[i]) == "yes") {
      cnt++;
    }
  }
  cout << cnt << "\n";
  return 0;
}
