#include <bits/stdc++.h>
using namespace std;
bool is_prime(int num) {
  int a = sqrt(num);
  for (int i = 2; i < a; i++) {
    if (num % i == 0) {
      return false;
    }
  }
  return true;
}
int main(void) {
  int n;
  cin >> n;
  int num;
  int prime_count = 0;
  for (int i = 0; i < n; i++) {
    cin >> num;
    if (is_prime(num) == true) {
      prime_count++;
    }
  }
  cout << prime_count << endl;
  return 0;
}
