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