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