Problem 11 solution.