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