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