include <stdio.h>

static const int N = 10000;

int main(){
  int i, j, k = 2, num[N], count = 0;

  scanf("%d",&i);
  for(j = 0; j < i; j++){
    scanf("%d",&num[j]);
    for(k = 2; k < num[j]; k++){
      if(num[j] < 2) break;
      if(num[j] % k == 0) break;
    }
    if(k == num[j]) count++;
  }
  printf("%d\n",count);
  
  return 0;
}