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