#include <iostream>
using namespace std;
int main() {
  int N; cin >> N;
  int ans = 0;
  for (int i = 0; i < N; i++) {
    int p; cin >> p;
    ans++;
    for (int j = 2; j*j <= p; j++) {
      if (p % j == 0) {
        ans--;
        break;
      }
    }
  }
  cout << ans << endl;
}

