#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, x, c;
  c = 0;
  cin >> N;
  for (int i = 1; i <= N; i++) {
    cin >> x;
    int fc;
    fc = 0;
    for (int j = 1; j <= sqrt(x); j++) {
      if (x % j == 0) {
        fc += 1;
        cout << j << "is a factor of " << x << endl;
      }
    }
    if (fc == 1) c += 1;
  }
  cout << c << endl;
  return 0;
}
