#include <bits/stdc++.h>
int main() {
  int i, j = 0, n, x = 0, y = 0;
  int *a;
  printf("?????°?????\?????????????????????\n");
  scanf("%d", &n);
  a = (int *)malloc(n * sizeof(int));
  printf("%d????????´??°?????\?????????????????????\n", n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < n; i++) {
    for (j = 2; j < a[i]; ++j) {
      if (a[i] % j == 0) {
        y++;
        break;
      }
    }
  }
  x = n - y;
  printf("%d\n", x);
  return 0;
}
