#include <bits/stdc++.h>
using namespace std;
int main() {
  long ar[10000];
  int i = 0, c = 0;
  int num;
  cin >> num;
  while (num--) {
    int flag = 0;
    cin >> ar[i];
    for (int n = 2; n <= ar[i] / 2; n++) {
      if (ar[i] % n == 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 0) c++;
    i++;
  }
  cout << c << endl;
  return 0;
}
