Again, with "quality" versus "quantity" it sounds like you're saying that there could be a lower quantity of people (some people die) in order to increase the quality of life for others.
If you find yourself taking this thought seriously and you're in the US, you can call 1-800-273-8255. Please take care.
But say I assign utilities like this:
Alive+rich = 5 Alive+poor = 1 Dead = 0
So 50% alive+rich, 50% dead has utility 2.5, while 100% alive+poor has utility 1.