Problem:
Prime Numbers

A prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. For example, the first four prime numbers are: 2, 3, 5 and 7.

Write a program which reads a list of N integers and prints the number of prime numbers in the list.

Input

The first line contains an integer N, the number of elements in the list.

N numbers are given in the following lines.

Output

Print the number of prime numbers in the given list.

Constraints

1 ≤ N ≤ 10000

2 ≤ an element of the list ≤ 108

Sample Input 1

5
2
3
4
5
6

Sample Output 1

3

Sample Input 2

11
7
8
9
10
11
12
13
14
15
16
17

Sample Output 2

4

Solution in C (judge verdict: Accepted)

#include <stdio.h>

#define TWO_EVEN 2												/*2???????????????*/
#define TRUE 1													/*??£??????*/
#define FALSE 0													/*?????????*/
#define INIT 0													/*?????????*/
#define INIT_INPUT 0											/*??\?????????????????????*/
#define INIT_CALC 3												/*?¨??????¨?????°?????????*/
#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 short usW_Cprime_cnt = INIT;						/*?´???°????????????*/
	unsigned char ubW_Fcnt_flug;								/*?´???°??????????????¨????????°*/

	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 long ulW_Fbool_flug;								/*?´???°?????\??¨????????°*/
	unsigned long ulW_Dcalc;									/*?¨??????¨?????°*/
	unsigned long ulW_Dcalc_sub;								/*????????¨?????°*/

	ulW_Dcalc = EVEN_DISC( ulW_Dtestcase );						/*??¶??°?????????????????\*/
	/*?????\????±????2?????´???*/
	if( ulW_Dtestcase == TWO_EVEN ){
		return TRUE;											/*?´???°??????????????£???????????????*/
	}
	/*?????\????±????2???????°???????????????¶??°?????£?????´???*/
	else if( ( ulW_Dtestcase < TWO_EVEN ) || ( ulW_Dcalc == INIT ) ){
		return FALSE;											/*?´???°??§????????????????????????????????????*/
	}
	ulW_Dcalc = INIT_CALC;										/*?¨??????¨?????°????????????*/
	ulW_Dcalc_sub = ulW_Dcalc * ulW_Dcalc;						/*????????¨?????°????¨??????¨?????°???2????????£??\*/
	/*?¨??????¨?????°???2???????????\????±???\????????´????????????*/
	while( ulW_Dcalc_sub <= ulW_Dtestcase ){
		ulW_Fbool_flug = ulW_Dtestcase % ulW_Dcalc;				/*?????\????±?????¨??????¨?????°??§?????????????????´???????????°???true???*/
		/*?´???°?????\??¨????????°???false?????´???*/
		if( ulW_Fbool_flug == FALSE ){
			return FALSE;										/*?´???°??§????????????????????????????????????*/
		}
		else{
			/*else?????????????????????????????\*/
		}
		ulW_Dcalc += TWO_EVEN;									/*?¨??????¨?????°???2?????????*/
		ulW_Dcalc_sub = ulW_Dcalc * ulW_Dcalc;					/*????????¨?????°????¨??????¨?????°???2????????£??\*/
	}
	return TRUE;												/*?´???°??????????????£???????????????*/
}