#include <bits/stdc++.h>
int main() {
  int n, i, x, count = 1;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &x);
    if (x % 3 != 0 || x % 5 != 0 || x % 7 != 0) {
      if (x == 2 || x % 2 == 1) {
        count++;
      }
    }
  }
  printf("%d\n", count);
  return 0;
}
