#include <bits/stdc++.h>
using namespace std;
int common(int x, int y) {
  if (!(x % y)) return y;
  return common(y, x % y);
}
int main() {
  int n, count = 0, x;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    bool flag = true;
    for (int j = x - 1; sqrt(x) <= j; j--) {
      if (common(x, j) != 1) {
        flag = false;
        break;
      }
    }
    if (flag) count++;
  }
  cout << count << endl;
}
