solve problem3