If everything in its stores costs a buck, it will take 8.5 billion items sold for Dollar Tree stores to buy rival Family Dollar.

Dollar Tree (DLTR) is buying its larger rival for 23% more than Family Dollar's closing price last week, for a total value of $8.5 billion.

Dollar Tree plans to continue to operate both the Dollar Tree and Family Dollar brands. Dollar Tree stores sell all items for $1 or less and CEO Bob Sasser told investors Monday they will continue to do so. Family Dollar stores sells many items for more than $1 and will stay with that pricing policy as well.

Dollar Tree stores are found mainly in suburban areas. Family Dollar stores are primarily in either urban or rural locations.

Combined, the two chains have more than 13,000 stores and annual revenue of $18 billion. That would surpass the current leader in the dollar-store sector, Dollar General (DG), which has more than 11,000 stores and revenue of $17.5 billion.

A big winner in the deal is activist investor Carl Icahn, who holds 9.4% of Family Dollar shares, according to sales tracker LionShares. Icahn acquired most of the shares in the past year.

Shares of the company shot up in June when Icahn disclosed his stake, but have given back most of the gains since. The stock is down nearly 6% for the year through Friday's close.

Shares of Family Dollar (FDO) soared on the news in early trading, while shares of Dollar Tree posted most modest gains.

Shares of Dollar General and Five Below (FIVE), a chain that sells items for $5 or less, were slightly lower on the news. So were shares of Wal-Mart Stores (WMT), the discount chain that is the nation's largest retailer.

The deal is expected to close early next year.

Tricks for spotting the best deals

Vacation home deals