public static void main ( String [] args ) {

	int a = 2000000;
	long sum = 0;

	for ( int i=1; i<a; i++ ) {
	    sum = sum + i;
	    for ( int j=2; j<=Math.sqrt(i); j++ ) {
		if ( i%j == 0 ) {
		    sum = sum - i;
		    break;
		}
	    }
	}

	System.out.println("sum = " + (sum-1));

    }