#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, a, ans = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> a;
    bool flag = true;
    if (a != 2 && a % 2 == 0 || a == 1) {
      flag = false;
    } else if (a != 2) {
      for (int j = 3; j * j < a; j += 2) {
        if (a % j == 0) {
          flag = false;
          break;
        }
      }
    }
    if (flag) {
      ans += 1;
    }
  }
  cout << ans << endl;
  return 0;
}
