#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
inline bool isPrime(int x) {
  if (x == 2) return true;
  if ((x & 1) == 0) return false;
  for (int i = 3; i * i < x; i += 2)
    if (x % i == 0) return false;
  return (true);
}
signed main() {
  cin.tie(0), ios::sync_with_stdio(false);
  int n;
  int x;
  int cnt = 0;
  cin >> n;
  while (n--) {
    cin >> x;
    if (isPrime(x)) ++cnt;
  }
  cout << (cnt) << '\n';
}
