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