#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, count = 0;
  cin >> n;
  int list[n];
  for (int i = 0; i < n; i++) cin >> list[i];
  for (int i = 0; i < n; i++) {
    for (int j = 2; j <= list[i]; j++) {
      if (j == list[i]) {
        count++;
        break;
      }
      if (list[i] % j == 0) break;
    }
  }
  cout << count << endl;
}
