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