There is a barber in the barber room, and 5 customers come at the same time. They are A, B, C, D, and E. According to the hairstyles they want, it takes 10 minutes, 12 minutes, 15 minutes, 20 minutes and 40 minutes respectively. Minutes, how to arrange the order of their haircuts so that the 5 people have the least haircut and waiting time? How many minutes is the minimum waiting time?
理发室里有一位理发师，同时来了5位顾客，他们分别是甲、乙、丙、丁、戊，根据他们所要理的发型，分别需要10分钟、12分钟、15分钟、20分钟和40分钟，怎样安排他们理发的顺序，才能使得5个人理发及等候的时间最少？最少需要等候多少分钟？
<gadget id="calculator">10 * 4</gadget>
<output>40</output>

<gadget id="calculator">12 * 3</gadget>
<output>36</output>

<gadget id="calculator">15 * 2</gadget>
<output>30</output>

<gadget id="calculator">40 + 36 + 30 + 20</gadget>
<output>126</output>

<result>126</result>