#include <bits/stdc++.h>
using namespace std;
using ll = long long;
bool isPrime(int x) {
  if (x <= 1) return false;
  if (x % 2 == 0 && x != 2) return false;
  for (int i = 3; i <= x / 2; i += 2) {
    if (x % i == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (isPrime(x)) {
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}
