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