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