#include <stdio.h>

#define ZERO 0
#define TWO 2
#define THREE 3
#define TRUE 1
#define FALSE 0
#define INIT 0
#define INIT_INPUT 0
#define INIT_CNT 1
#define EXIT_SUCCESS 0
#define EVEN_DISC( x ) x % 2

static unsigned char prime_disc( unsigned long ulW_Dtestcase );

int main( void )
{
	unsigned long ulW_Dtestcase;
	unsigned short usW_Darray_count;
	unsigned short usW_Cinput_cnt;
	unsigned char ubW_Fcnt_flug;
	unsigned short usW_Cprime_cnt = INIT;

	scanf("%d", &usW_Darray_count);
	for( usW_Cinput_cnt = INIT_INPUT; usW_Cinput_cnt < usW_Darray_count; usW_Cinput_cnt++){
		scanf("%ld", &ulW_Dtestcase );
		ubW_Fcnt_flug = prime_disc( ulW_Dtestcase );
		if( ubW_Fcnt_flug == TRUE ){
			usW_Cprime_cnt++;
		}
		else{
			/*else?????????????????????????????\*/
		}
	}
	printf("%d\n", usW_Cprime_cnt);
	return EXIT_SUCCESS;
}

static unsigned char prime_disc( unsigned long ulW_Dtestcase )
{
	unsigned char ubW_Fbool_flug;
	unsigned long ulW_Dcalc;
	unsigned long ulW_Dcalc_sub;
	
	ulW_Dcalc = EVEN_DISC( ulW_Dtestcase );
	if( ulW_Dtestcase == TWO){
		return TRUE;
	}
	else if( ( ulW_Dtestcase < TWO ) || ( ulW_Dcalc == ZERO ) ){
		return FALSE;
	}
	ulW_Dcalc = THREE;
	ulW_Dcalc_sub = sqrt( ulW_Dtestcase );
	while( ulW_Dcalc <= ulW_Dcalc_sub ){
		ubW_Fbool_flug = ulW_Dtestcase % ulW_Dcalc;
		if( ubW_Fbool_flug == FALSE ){
			return FALSE;
		}
		else{
			/*else?????????????????????????????\*/
		}
		ulW_Dcalc += TWO;
		ulW_Dcalc_sub = sqrt( ulW_Dtestcase );
	}
	return TRUE;
}

//9??¨15??§?????°