#include<stdio.h>
int main(){
int check(int); 
 int n;
 int number[10000];
 int i;
 int count=0;
 
 scanf("%d",&n);
 
 for(i=0;i<n;i++){
     scanf("%d",&number[i]);
     if(check(number[i]) == 1) count++;
      }
 }
 printf("%d\n",count);
 return 0;
}

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

