Solve problem 5