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