#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, num, count_d, count_p = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    count_d = 0;
    cin >> num;
    for (int j = 1; j <= (num / 2); j++) {
      if (num % j == 0) {
        ++count_d;
      }
    }
    if (count_d == 1) {
      ++count_p;
    }
  }
  cout << count_p << endl;
  return 0;
}
