#include <stdio.h>
int main(void){
    int record = 0;
    int roopCount1 = 0;
    int primeCount = 0;
    int divisibleCount = 0;
    scanf("%d",&record);
    for(roopCount1 = 0; roopCount1 < record; roopCount1++){
        int number[record];
        scanf("%d",&number);
        int roopCount2 = 2;
        for(roopCount2 = 2; roopCount2 <= number; roopCount2++){
            if((number % roopCount2) == 0) {
                ++divisibleCount;
            }  
        }
        if(divisibleCount == 1) ++primeCount;
        divisibleCount = 0;
    }
    printf("%d\n",primeCount);
    return 0;
}