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