#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
inline bool chmax(A &a, B b) {
  return b > a ? a = b, 1 : 0;
}
template <class A, class B>
inline bool chmin(A &a, B b) {
  return b < a ? a = b, 1 : 0;
}
inline int updiv(int a, int b) { return ((a + b - 1) / b); }
bool prime(int n) {
  if ((n & 1) == 0) return (n == 2);
  for (int i = 3; i * i < n; i += 2) {
    if (n % i == 0) return (false);
  }
  return (true);
}
int main() {
  cin.tie(0), ios::sync_with_stdio(false);
  int n, a, cnt = 0;
  cin >> n;
  while (n--) {
    cin >> a;
    cnt += prime(a);
  }
  cout << (cnt) << '\n';
}
