solve problem 27