#include <bits/stdc++.h>
int main() {
  int n, i, j, count = 0, num;
  scanf("%d", &n);
  if (n < 1 || n > 10000) exit(2);
  for (i = 0; i < n; i++) {
    scanf("%d", &num);
    for (j = 2; j < num; j++) {
      if (num % j == 0) {
        count++;
        break;
      }
    }
  }
  printf("%d\n", n - count);
  return 0;
}
