#include <bits/stdc++.h>
using namespace std;
int countPrimeNumbers(int nums[], int n);
int main(void) {
  int n, nums[10000];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> nums[i];
  }
  int count = countPrimeNumbers(nums, n);
  cout << count << endl;
  return 0;
}
int countPrimeNumbers(int nums[], int n) {
  int count = 0;
  for (int i = 0; i < n; i++) {
    if (nums[i] == 2) {
      count++;
      continue;
    }
    int j = 0, flag = 0;
    int num_sqrt = sqrt(nums[i]);
    for (j = 3; j <= num_sqrt; j += 2) {
      if (nums[i] % j == 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 0) count++;
  }
  return count;
}
