#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int x;
  int check = 0;
  int cnt = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    for (int j = 1; j <= x; j++) {
      if (x % j == 0) {
        check++;
      }
    }
    if (check == 2) {
      cnt++;
    }
    check = 0;
  }
  cout << cnt << "\n";
}
