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