#include <bits/stdc++.h>
static clock_t start_time, end_time;
void clock_start() { start_time = clock(); }
void clock_end(char* msg) {
  end_time = clock();
  printf("[%s]%ld\n", msg, (end_time - start_time));
}
int main(int argc, char** argv) {
  int n, data;
  int count;
  int i, j, data_root, found;
  count = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &data);
    found = 0;
    data_root = (int)sqrt(data) + 1;
    for (j = 2; j <= data_root; j++) {
      if (data % j == 0) {
        found = 1;
        break;
      }
    }
    if (!found) {
      count++;
    }
  }
  printf("%d\n", count);
  return 0;
}
