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