#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, count = 0;
  bool judge = true;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> m;
    for (int j = 2; j < sqrt(m); j++) {
      if (m % j == 0) judge = false;
    }
    if (judge) count++;
  }
  cout << count << endl;
  return 0;
}
