#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int p, prime = 0;
  int cnt = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> p;
    if (p == 0 || p == 1) break;
    cnt = 0;
    for (int j = 2; j <= p; j++) {
      if (p % j == 0) cnt++;
    }
    if (cnt == 1) prime++;
  }
  cout << prime << endl;
}
