#include <bits/stdc++.h>
int main() {
  int n, i, ans;
  scanf("%d", &n);
  int R[n];
  for (i = 0; i < n; i++) {
    scanf("%d", R[i]);
  }
  ans = n;
  for (i = 0; i < n; i++) {
    while (1) {
      if (R[i] % 2 > 1) {
        ans--;
        break;
      } else if (R[i] % 3 > 1) {
        ans--;
        break;
      } else if (R[i] % 5 > 1) {
        ans--;
        break;
      } else if (R[i] % 7 > 1) {
        ans--;
        break;
      }
    }
  }
  printf("%d", ans);
  return 0;
}
