#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 10000;
int k, i;
bool isPrime(int val) {
  if (val < 2) return false;
  for (k = 2; k * k <= val; k++) {
    if (val % k == 0) {
      return false;
    }
    return true;
  }
}
vector<int> prime_line(int n) {
  bool dp[n];
  vector<int> prime;
  for (i = 0; i < n; ++i) {
    dp[i] = false;
  }
  dp[0] = dp[1] = true;
  for (i = 2; i < n; i += k) {
    if (dp[i] == true) continue;
    prime.push_back(i);
    for (int j = i * 2; j < n; j += i) {
      dp[j] = true;
    }
  }
  return prime;
}
int main() {
  int n;
  int val, cnt;
  cnt = 0;
  cin >> n;
  for (i = 0; i < n; ++i) {
    cin >> val;
    if (isPrime(val)) {
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}
