#include <bits/stdc++.h>
int gcd(int x, int y) {
  int ans;
  if (x == 0) {
    return y;
  } else if (y == 0) {
    return x;
  } else if (x > y) {
    ans = gcd(y, x % y);
  } else {
    ans = gcd(x, y % x);
  }
  return ans;
}
int main(void) {
  int n;
  scanf("%d", &n);
  int ans = n;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    int j = 2;
    while (j < x) {
      if (gcd(j, x) != 1) {
        ans--;
        break;
      } else {
        j++;
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
