#include <bits/stdc++.h>
using namespace std;
bool isPrime(int num) {
  if (num <= 3) {
    return num > 1;
  } else if (num % 2 == 0 || num % 3 == 0) {
    return false;
  } else {
    for (int i = 5; i * i <= num; i += 6) {
      if (num % i == 0 || num % (i + 2) == 0) {
        return false;
      }
    }
    return true;
  }
}
int main() {
  int t;
  cin >> t;
  vector<int> v(t, 0);
  while (t--) {
    int n;
    cin >> n;
    vector<int> v(n, 0);
    if (isPrime(n)) {
      v.push_back(n);
    }
  }
  cout << v.size() << endl;
  return 0;
}
