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