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