#include <stdio.h>
#define N 10000
int main() {
  int num = 0;
  int i, j, length, flag, data[N];
  scan("%d",&length);
  for(i = 0; i < length; i++){
    scan("%d", &data[i]);
  }
  for(i = 0; i < length; i++){
    flag = 0;
    for(j = 2; j < data[i]; ++j){
      if(data[i] % j == 0) {
        flag = 1;
        break;
      }
    }
    if(flag == 0) num++;
  }
  printf("\n%d\n", num);
  return 0;
}