#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned int n;
  cin >> n;
  unsigned int num, count = 0;
  for (int i = 0; i < n; i++) {
    cin >> num;
    for (int j = 2; j < num; j++) {
      if (num % j == 0) {
        break;
      }
      if (num - 1 == j) {
        count++;
      }
    }
    if (num == 2) {
      count++;
    }
  }
  cout << count << std::endl;
  return 0;
}
