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