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