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