#include<stdio.h>
#include<stdlib.h>
int main() {
    int i,hantei_sosu=0,count=0,n,sosu,j;
    
    scanf("%d",&n);
    
    sosu = malloc(n * sizeof (int));
    
    for(i=0;i<n;i++){
        scanf("%d",&sosu[i]);
    }
    
    for(i=0;i<n;i++){
        for(j=1;j<=sosu[i];j++){
            if(sosu[i] % j == 0) hantei_sosu++; 
        }
        if(hantei_sosu == 2) count++;
        hantei_sosu = 0;
    }
    
    printf("%d\n",count);
    return 0;
}
