public static void main(String[] args){
		long start = System.nanoTime();
		int sum = 2;
		int p = 1;
		int p2 = 2;
		
		//fibNum() is not used for the sake of performance
		while(p < 4000000 && p2 < 4000000){
			p = p+p2;
			if(p%2 == 0 && p < 4000000){
				sum += p;
			}
			p2 = p+p2;
			if(p2%2 == 0 && p2 < 4000000){
				sum += p2;
			}
		}
		System.out.println(sum);
		System.out.println("Done in " + (double) (System.nanoTime() - start)
				/ 1000000000 + " seconds.");
	}