#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, count;
  cin >> n;
  count = 0;
  while (cin >> m) {
    if (m == 2)
      ++count;
    else if (m < 2 || m % 2 == 0) {
      continue;
    } else {
      i = 3;
      while (m <= sqrt(i)) {
        if (m % i == 0) continue;
        i = i + 2;
      }
      if (m > sqrt(i)) {
        ++count;
      }
    }
  }
  cout << count << endl;
  return 0;
}
