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