To solve this problem, we can use a compound rule of three.
The quantity of chocolate and the weight of each chocolate are inversely proportional: to achieve the same earning, if we have more chocolate, we need less grams per chocolate.
Then, the rate of change in quantity multiplied by the rate of change in the grams will be equal to the rate of change in the final earning.