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