#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, N, ans = 0;
  bool b;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> N;
    b = true;
    if (N == 1 || N == 4 || N == 6 || N == 8) {
      b = false;
    }
    if (N % 2 == 0) b = false;
    for (int j = 3; j < sqrt(N); j += 2) {
      if (N == 2) {
        ans++;
        break;
      } else if (N % j == 0) {
        b = false;
        break;
      }
    }
    if (b) ans++;
  }
  cout << ans << endl;
  return 0;
}
