#include <bits/stdc++.h>
using namespace std;
bool isPrime(int p) {
  if (p == 2) return true;
  if (p < 2 || p % 2 == 0) return false;
  for (int i = 3; i * i <= p; i += 2) {
    if (p % i == 0) return false;
  }
  return true;
}
int main() {
  int N;
  cin >> N;
  int count = 0, p;
  for (int i = 0; i < N; i++) {
    cin >> p;
    ;
    if (isPrime(p)) count++;
  }
  cout << count;
  ;
  return 0;
}
