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