#include<stdio.h>
int isPrime(int);

int main(){
  int x[10000];
  int N,i,sosu,n=0;
  
  scanf("%d",&N);
  for(i = 0; i < N; i++){
    scanf("%d",&x[i]);
    sosu = isPrime(x[i]);
    if(sosu == 1){n++;}
  }
  printf("%d\n",n);
  return 0;
}

int isPrime( int x ){
  int i;
  if (x <= 1)return 0;
  if(x == 2)return 1;
  for (i = 2; x-1; i++){
    if (x % i == 0 )return 0;