#include <bits/stdc++.h>
int main() {
  int i, j, num, count;
  int pri[10000];
  scanf("%d", &num);
  count = num;
  for (i = 0; i < num; i++) {
    scanf("%d", &pri[i]);
    if (pri[i] < 2 || pri[i] > 10e8) {
      printf("Error.\n");
      exit(1);
    }
  }
  for (i = 0; i < num; i++) {
    for (j = 2; j < pri[i]; j++) {
      if (pri[i] % j == 0) {
        count--;
        break;
      }
    }
  }
  printf("%d\n", count);
  return 0;
}
