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