solving problem 14