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