Solve problem 52 using Java.