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