#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int count = 0;
  while (n--) {
    int x;
    cin >> x;
    if (x == 2) {
      count++;
      continue;
    }
    if (x % 2 == 0) {
      count++;
      continue;
    }
    for (int i = 3; pow(i, 2) <= x; i += 2)
      if (x % i == 0) {
        count++;
        break;
      }
  }
  cout << count << endl;
  return 0;
}
