#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int x;
  int count = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> x;
    for (int j = 2; j < x; j++) {
      if (x != 2) {
        if (x % j == 0) {
          count++;
          break;
        }
      }
    }
  }
  cout << N - count << endl;
  return 0;
}
