#include <stdio.h>

int main(void){

    int l, n, i, j, count = 0;

    scanf("%d", &l); 

    for(i = 1; i <= l; i++){

        scanf("%d", &n); 

        if (n ==2 || n == 3 || n = 5){
            count++;
        }else if(n != 1 && n%2 != 0){
            for (j = 3; j <= n/2; j+=2) {
                if(n%j == 0){
                    break;
                }
                if(j == n/2-1 || j == n/2){
                    count++;
                    break;
                }
            }
        } 
    }

    printf("%d\n", count);
    return 0;
}
