#include <bits/stdc++.h>
int main(void) {
  int n, i, j, k, 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] % 3 != 0 && x[i] % 5 != 0) {
      j = x[i] - 1;
      while (j) {
        if (j % 2 != 0 && j % 3 != 0 && j % 5 != 0) {
          if (x[i] % j == 0) break;
        }
        j--;
      }
      if (j == 1) k++;
    } else if (x[i] == 2 || x[i] == 3 || x[i] == 5)
      k++;
  }
  printf("%d\n", k);
  return 0;
}
