Using 1 gram, 3 gram, 9 gram, and 27 gram weights each, and allowing them to be placed on both sides of the balance, how many different weights can be weighed in total?
用1克、3克、9克、27克的砝码各一枚，允许放在天平的两侧，共可以称出多少种不同的重量．
<gadget id="calculator">27 + 9 + 1 + 3</gadget>
<output>40</output>

<result>40</result>