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