#include <bits/stdc++.h>
int main() {
  int x, box[10000], i, n, k, ans = 0, m;
  scanf("%d\n", &n);
  for (k = 0; k < n; k++) scanf("%d\n", &box[k]);
  for (x = 0; x < n; x++) {
    if (box[x] == 2) ans++;
    if (box[x] > 2 && box[x] % 2 == 1) {
      for (i = 3; i <= sqrt(box[x]); i += 2) {
        m = 0;
        if (box[x] % x == 0) {
          m = 1;
          break;
        }
        if (m == 0) ans++;
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
