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