#include <bits/stdc++.h>
int main(void) {
  int n, i, j, ans = 0, x[10000];
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &x[i]);
  }
  for (i = 0; i < n; i++) {
    if (x[i] % 2 != 0 || x[i] == 2) {
      if (x[i] <= 512 * 3) {
        for (j = 3; j < x[i] / 2; j += 2) {
          if (x[i] % j == 0) {
            break;
          }
        }
        if (j >= x[i] / 2 || x[i] == 2) ans++;
      } else if (x[i] >= 512 * 3) {
        for (j = 3; j < x[i] / 512; j += 2) {
          if (x[i] % j == 0) break;
        }
        if (j >= x[i] / 512) ans++;
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
