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