#include <bits/stdc++.h>
int main() {
  int i, n, k, l, c = 0;
  long j, v;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%ld", &v);
    if (v == 2l || v == 3l || v == 5l) {
      c++;
      continue;
    }
    for (j = 7l; j <= v; j++) {
      if (j % 2l == 0 || j % 3l == 0 || j % 5l == 0) {
        continue;
      }
      if (j / v == 1) {
        c++;
        break;
      }
    }
  }
  printf("%d\n", c);
  return 0;
}
