#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, i, tmp;
  int cnt = 0;
  cin >> n;
  while (cin >> a) {
    tmp = 0;
    for (i = 2; i < a; i++) {
      if ((a % i) == 0) tmp++;
    }
    if (tmp == 0) cnt++;
  }
  cout << cnt << endl;
}
