Three customers A, B, and C came to the barbershop at the same time. It takes 7 minutes for A to cut the hair, 10 minutes for B to shave, and 40 minutes for C to perm. I would like to ask: How to arrange the haircut order of these three people so that the sum of the time spent by the three of them is the shortest? What is the shortest time for this?
理发店里同时来了A、B、C三个顾客，A理板寸需要7分钟，B理光头需要10分钟，C烫卷发需要40分钟．请问：如何安排这三个人的理发顺序才能使得他们三人所花的时间总和最短？这个最短的时间是多少？
<gadget id="calculator">7 + 10</gadget>
<output>17</output>

<gadget id="calculator">7 + 10 + 40</gadget>
<output>57</output>

<gadget id="calculator">7 + 17 + 57</gadget>
<output>81</output>

<result>81</result>