Solve problem 3