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