#include <bits/stdc++.h>
int main() {
  int i, f, j, l, count;
  long a[10000];
  count = 0;
  scanf("%d", &l);
  for (i = 0; i < l; i++) scanf("%ld", &a[i]);
  for (i = 0; i < l; i++) {
    f = 0;
    if (a[i] == 2)
      f = 0;
    else if (a[i] == 1 || (a[i] % 2) == 0)
      f = 1;
    else {
      for (j = 3; j < a[i]; j += 2)
        if ((a[i] % j) == 0) {
          f = 1;
          break;
        }
    }
    if (f == 0) count++;
  }
  printf("%d\n", count);
  return 0;
}
