#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a < b) return gcd(b, a);
  if (b == 0) return a;
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
signed main() {
  long long n, m;
  cin >> n;
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    cin >> m;
    if (m == 2) {
      ans++;
      continue;
    }
    if (m % 2 == 0) {
      continue;
    }
    bool b = true;
    for (long long i = 3; i < min(10001ll, m - 1); i += 2) {
      if (m % i == 0) {
        b = false;
        break;
      }
    }
  }
  cout << ans << endl;
}
