#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
  int r;
  while (y > 0) {
    if (y > x) swap(x, y);
    r = x % y;
    x = y;
    y = r;
  }
  return x;
}
int main(void) {
  int n;
  cin >> n;
  int sum = 0;
  int x, hantei = true;
  for (int i = 0; i < n; i++) {
    cin >> x;
    hantei = true;
    for (int j = 1; j < x; j++) {
      if (gcd(x, j) != 1) {
        hantei = false;
      }
    }
    if (hantei == true) sum++;
  }
  cout << sum << endl;
}
