public static void main ( String [] args ) {

	int a, b, c;
	int sum = 0;

	a = 1;
	b = 2;
	c = 0;

	while ( c < 4000000 ) {
	    c = a + b;
	    a = b;
	    b = c;

	    if ( c % 2 == 0 ) {
	       	sum = sum + c;
	    }

	}

	System.out.println("sum = " + (sum+2));
    }