#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;
    for (int j = 2; j < a; j++) {
      if (a % j == 0) kazu++;
    }
    if (kazu == 0)
      ans++;
    else
      kazu = 0;
  }
  cout << ans << endl;
  return 0;
}
