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