#include <bits/stdc++.h>
using namespace std;
bool isprime(int number) {
  if (number == 1) {
    return false;
  }
  if (number == 2) {
    return true;
  }
  if (number % 2 == 0) {
    return false;
  }
  for (int i = 3; i < number; i += 2) {
    if (number % i == 0) return false;
  }
  return true;
}
int main(int argc, char const *argv[]) {
  int count;
  cin >> count;
  int prime_count = 0;
  for (int i = 0; i < count; i++) {
    int number;
    cin >> number;
    if (isprime(number)) {
      prime_count++;
    }
  }
  cout << prime_count << endl;
  return 0;
}
