#include <bits/stdc++.h>
int a[10000000];
int main() {
  int n, i, f = 0, j, k = 0;
  while (scanf("%d", &n) != EOF) {
    for (i = 0; i < n; i++) {
      scanf("%d", &a[i]);
    }
    k = 0;
    for (i = 0; i < n; i++) {
      j = 2;
      while (j < a[i]) {
        if (a[i] % j == 0) break;
        j++;
      }
      if (j == a[i]) k++;
    }
    printf("%d\n", k);
  }
  return 0;
}
