solving problem 13