Solve problem3