#include <stdio.h>
int main() {
  int n,count = 0;
  long x;
  double tmp;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%ld", &x);
    tmp = x/2;
    for (int j = 2; j <= tmp; j++) {
      if (x%j == 0) {
        count++;
        break;
      }
      tmp = x / (j + 1);
    }
  }
  printf("%d\n", n - count);
  return 0;
}

