#include <bits/stdc++.h>
using namespace std;
bool check_prime(int n) {
  int i = 2;
  bool flg = true;
  while (i < n) {
    if (n % i == 0) {
      flg = false;
      break;
    } else {
      i++;
    }
  }
  return flg;
}
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;
}
