#include <stdio.h>
 
int prime (int x) {
    int i;
    if ((x != 2) && (x % 2 == 0)) {
        return 0;
    }else if ( x ==  2) {
        return 1;
    }
 
    if ( x < 2 ) {
        return 0;
    }
 
    for ( i = 3; i * i <= x; i += 2 ) {
        if ( x % i == 0 ) {
            return 0;
        }
    }
 
    return 1;
}
 
int main () {
    int a, m, count = 0, n;
    scanf("%d", &n);
 
    for ( a = 0; a < n; a++ ) {
        scanf("%d", &m);
        if ( prime(m) == 1 ) {
            count++;
        }
    }
 
    printf("%d\n", count);
 
    return 0;
}
