#include <bits/stdc++.h>
int data[(10000)];
int out_data[(10000)];
int out_data_num;
int main() {
  int n, i, k, flg;
  char buff[8192];
  double cnt;
  out_data_num = 0;
  gets(buff);
  sscanf(buff, "%d", &n);
  for (i = 0; i < n; i++) {
    gets(buff);
    sscanf(buff, "%d", &(data[i]));
  }
  for (i = 0; i < n; i++) {
    if (data[i] == 2) {
      out_data[out_data_num] = data[i];
      out_data_num++;
      continue;
    }
    if ((data[i] < 2) || ((data[i] % 2) == 0)) {
      continue;
    }
    cnt = (int)sqrt((double)data[i]);
    for (flg = 1, k = 3; k < cnt; k += 2) {
      if ((data[i] % (k)) == 0) {
        flg = 0;
        break;
      }
    }
    if (flg == 1) {
      out_data[out_data_num] = data[i];
      out_data_num++;
    }
  }
  printf("%d\n", out_data_num);
  return 0;
}
