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