More than 20 million Americans could lose health insurance from the repeal of Obamacare. But not everybody would suffer. And among those who stand to gain are the richest people in America.

That’s because Obamacare didn’t just change insurance arrangements. It also raised taxes on corporations and individuals. Repealing the law would mean repealing those taxes, with significant benefits going to millionaires and multimillionaires. President-elect Donald Trump might even be one of them.

When Democrats sat down to craft what became the Affordable Care Act, they committed to creating a fiscally sound program ― for every new dollar in government spending, they pledged, they would find at least one dollar of new revenue or one dollar of lower spending somewhere else. And Democrats were good to their word. They wrote legislation that, according to the Congressional Budget Office, has actually resulted in net savings for the federal treasury.

To achieve this goal, Obamacare’s architects drew on several sources of money. A huge chunk is coming from hospitals, drug makers and other parts of the health care industry in the form of new fees or reductions in the compensation these companies get from Medicare.

Additional money comes via the individual mandate ― that is, from people who end up paying the income tax penalty for not buying coverage when the law deems it affordable. This year, it looks like roughly 7 million tax filers ended up paying the penalty, at an average of $498 each, according to a tabulation by Jed Graham of Investor’s Business Daily.

When it comes to individual taxes, however, by far the largest revenue source is a new levy on income. Technically it is part of the Medicare Hospital Insurance tax. But this new tax is a “surcharge,” and it differs from the rest of the Medicare tax in two critical respects.

One is that it falls exclusively on wealthy households ― specifically, on married couples with annual incomes above $250,000 and on single people with annual incomes above $200,000. When Obamacare first became law, the Brookings-Urban Institute Tax Policy Center estimated that initially fewer than 3 percent of tax filers would have incomes high enough to incur the new tax, with the percentage growing slowly over time because the law does not adjust the thresholds for inflation.

The other distinctive quality is that this surcharge includes investment income. That’s a big deal, since the rest of the Medicare tax covers wages only. Wealthy Americans are more likely than others to make a lot of money from stocks, real estate and other holdings, and that’s especially true for the richest of the richest.

For affected households with annual incomes in low six digits (between $200,000 and $500,000), the average tax increase upon the law’s implementation was just $467 a year, according to calculations by the Tax Policy Center. That worked out to an increase of 0.2 percent. Millionaires, however, faced a steeper increase. For filers with annual incomes above $1 million, the average tax increase was $36,310, or an increase of 1.2 percent.

They can afford that kind of money, for sure. But it’s safe to assume most of them would be happy not pay that tax anymore. Which is great, except that if the tax goes away, so will the revenue ― to the tune of $346 billion over the next 10 years, by the CBO’s reckoning.

That’s money Republicans wouldn’t have at their disposal for the Obamacare “replacement” scheme they have promised, making it more difficult to extend insurance coverage as much as Obamacare has. Not coincidentally, the major conservative plans now in circulation typically result in some combination of fewer insured and less generous coverage.

The policy trade-off here is straightforward. Lawmakers can reduce taxes on the wealthiest Americans or they can plow that money into helping some subset of poor and middle-class Americans pay their medical bills.

Want to guess which option Republicans will choose?