#include <bits/stdc++.h>
int isPrime(int x);
int main(void) {
  int n, i;
  int count = 0;
  int *p;
  scanf("%d", &n);
  p = (int *)malloc(sizeof(int) * n);
  if (p == NULL) {
    printf("memory error\n");
    exit(1);
  }
  for (i = 0; i < n; i++) {
    scanf("%d", &p[i]);
  }
  for (i = 0; i < n; i++) {
    if (isPrime(p[i]) == 1) {
      count++;
    }
  }
  printf("%d", count);
  free(p);
  return 0;
}
int isPrime(int x) {
  int i;
  int k = 3;
  if (x == 2) {
    return 1;
  } else if (x < 2 || (x % 2 == 0)) {
    return 0;
  } else {
    while (k <= (int)sqrt((double)x)) {
      if (x % k == 0) {
        return 0;
      }
      k += 2;
    }
    return 1;
  }
}
