#include <bits/stdc++.h>
int main() {
  using namespace std;
  int len;
  cin >> len;
  int* num = new int[len];
  int count = 0;
  for (int i = 0; i < len; i++) {
    cin >> num[i];
    int isprime = 1;
    for (int j = 2; j < num[i]; j++) {
      if (num[i] % j == 0 && num[i] != j) {
        isprime = 0;
        break;
      }
    }
    if (isprime) count++;
  }
  cout << count << endl;
  return 0;
}
