#include <stdio.h>
#include <math.h>

main()
{
int n, i, j, flag, count=0;
int a[10000];
scanf(???%d???, &n);

for(i=0; i<n; i++){
flag = 0;
scanf(???%d???, &a[i]);

if(a[i] < 2) flag = 0;
else if(a[i] == 2) flag = 1;

if(a[i]%2 == 0) flag = 0;
else if{
for(j=3; j <= a[i]/j; j+=2){
if(a[i]%j == 0) flag = 0;
}
}
else flag=1;

if(flag == 1) count++;
}

printf(???%d?\n???, count);
}