#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, kazu = 0, ans = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a == 2 || a % 2 == 1) {
      for (int j = 2; j < a; j++) {
        if (a % j == 0) {
          kazu++;
          break;
        }
      }
      if (kazu == 0)
        ans++;
      else
        kazu = 0;
    }
  }
  cout << ans << endl;
  return 0;
}
