#include <bits/stdc++.h>
using namespace std;
bool check_prime(int n) {
  int i = 2;
  while (i < n) {
    if (n % i == 0)
      return false;
    else {
      i++;
    }
  }
  return true;
}
int main() {
  int N;
  const int MAX_N = 10000;
  cin >> N;
  int arr[MAX_N];
  for (int i = 0; i < N; i++) {
    cin >> arr[i];
  }
  int count = 0;
  for (int i = 0; i < N; i++) {
    if (check_prime(arr[i]) == true) {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
