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