#include<stdio.h>

int main() {
    int n, i, j, a;
    int nun[10000];
    int count = 0;
    
    scanf("%d\n", &n);
    
    for (i = 0; i < n; i++)
        scanf("%d\n", &nun[i]);
    
    for (i = 0; i < n; i++){
        a = 0;
        
        if (nun[i] == 2)
            a = 1;
        else if ((nun[i] < 2) && (nun[i] % 2 == 0))
            a = 0;
        else {
            for(j = 3; j <= sqrt(nun[i]); j++){
                if(nun[i] % j == 0)
                    a = 1;
            }
        }
        if(a == 1)
            count++;
    }
    
    printf("%d\n", count);
    
}