If it sometimes feels like there is a drugstore at practically every intersection in the United States, some relief is on the way.
Walgreens Boots Alliance wba said on Wednesday it would close nearly 600 of the 1,932 Rite Aid rad stores it is buying in a $4.375 billion cash deal set to close in the spring of 2018. The company two years ago had planned to buy smaller rival Rite Aid in its 4,500-store entirety but in the face of anti-trust regulators balking in June, instead settled for a downsized deal announced in September. A few Walgreens stores are also being closed.
The locations being closed were chosen because of overlap with another Rite Aid or Walgreens location, executives said.
More from FORTUNE
“The vast majority being closed are within one mile of another drugstore that we own going forward,” Alexander Gourlay, WBA’s co-chief operating officer, told Wall Street analysts on a conference call to discuss its latest quarterly results. The closings will take about a year and half and begin soon after the deal closes. Walgreens expects to pay about $500 million in additional capital spending to convert the stores it is buying but keeping.
It’s easy to see why Walgreens wants to reduce overlap: comparable retail sales fell 2.1% in its most recent quarter, so it does not need more of its own stores competing with each other. Rival druggist CVS Health cvs , with nearly 9,700 locations, is also struggling with declining comparable sales of front-of-store merchandise. Both chains’ prescriptions businesses in contrast are growing. After the deal closes, Walgreens will have roughly the same number of stores as CVS, up from 8,000 now.
WBA, which also operates stores in Europe under the Boots name, said sales at Walgreens’ U.S. pharmacies rose 12.6% in the fiscal fourth quarter ended Aug. 31, and the company filled 250.2 million prescriptions, up 9%. The company also said it expects 2018 adjusted earnings of $5.40 to $5.70 per share, better than analysts’ average estimate of $5.47, according to Thomson Reuters I/B/E/S. Revenue rose 5.3% to $30.15 billion, above Wall Street forecasts.
As for profit, it took a hit from the $325 million termination fee it had to pay Rite Aid for the aborted merger. But excluding that and other one-time expenses, WBA earned $1.31 per share, above the Street’s forecasts for $1.21, sending its shares up 3%. Last month, Rite Aid had blamed the merger drama for weak results.