#include <stdio.h>
pp(int b)
{
int i ;
int sq;
sq=( int )(b/2);
for ( i = 2 ; i <= sq ; i++ ) {
if (b % i == 0 )
{ break ; }
} if ( i <= sq ) return 0;
else return 1 ;
}
int main()
{long x,y;
int z=0;
for(x=2 ; x<10000000/2 ; x++)
for(y=10000000/2 ; y<10000000 ; y++)
if ((pp(x)==1 && pp(y)==1 )&& x+y==10000000)
z++;
printf("%d\n",z);
sleep(5000);
return 0;
}