#include <bits/stdc++.h>
using namespace std;
bool isPrime(int a) {
  int b = a / 2;
  if (a == 1) return false;
  for (int i = b; i >= 1; i--) {
    if (a % i == 0 && i != 1) return false;
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  int number[n];
  for (int i = 0; i < n; i++) {
    cin >> number[i];
  }
  int count = 0;
  for (int p = 0; p < n; p++) {
    if (isPrime(number[p])) count++;
  }
  cout << count << endl;
  return 0;
}
