#include <bits/stdc++.h>
using namespace std;
int prime(int num) {
  if (num == 2 || num == 3 || num == 5) {
    return 1;
  }
  for (int k = 2; k < num / 2; k++) {
    if (num % k == 0) {
      return 0;
    }
  }
  return 1;
}
int main() {
  int N;
  cin >> N;
  int count = 0;
  for (int i = 0; i < N; i++) {
    int num;
    cin >> num;
    count += prime(num);
  }
  cout << count << endl;
  return 0;
}
