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