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