A man stands at a point A on the bank of a straight river, 1 miles wide. To reach a point C that is 7 miles downstream on the opposite bank (distance between point B and C), he first rows his boat to point P on the opposite bank and then walks the remaining distance x to C, as shown in the figure. He can row at a speed of 2 miles/hour and walk at a speed of 5 miles/hour. Express the total time needed for the trip as a function of x.