#include <bits/stdc++.h>
int main(void) {
  int i, j, n, input, rt, count = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &input);
    count++;
    if (input % 2 == 0) {
      count--;
      continue;
    }
    rt = sqrt(input);
    for (j = 3; j <= rt; j += 2) {
      if (input % j == 0) {
        count--;
        break;
      }
    }
  }
  printf("%d\n", count);
  return 0;
}
