#include <bits/stdc++.h>
using namespace std;
int x, n, i, j = 3;
float isprime() {
  if (x == 2)
    return true;
  else if (x < 2 || x % 2 == 0)
    return false;
  else {
    while (j <= sqrt(x)) {
      if (x % j == 0) {
        return false;
      }
      j = j + 2;
    }
    return true;
  }
}
int main() {
  int count = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> x;
    isprime();
    if (isprime() == true) count++;
  }
  cout << count << endl;
  return 0;
}
