#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int i;
  int count = 0;
  int x[20000];
  int s;
  s = sqrt(x[i]) + 1;
  for (i = 0; i < n; i++) {
    scanf("%d", &x[i]);
    if (x[i] == 2) {
      count = count + 1;
    }
    if (x[i] % 2 != 0) {
      int count2 = 0;
      int j;
      for (j = 2; j <= s; j++) {
        if (x[j] % s == 0) {
          count2 = count2 + 1;
        }
      }
      if (count2 == 0) {
        count = count + 1;
      }
    }
  }
  printf("%d\n", count);
  return 0;
}
