Solve problem 24