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