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