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