(Reuters) - Walgreens Boots Alliance Inc WBA.O said on Thursday it would consolidate warehouses and shut some stores as part of a cost-cutting plan aimed at saving more than $1 billion annually.

A customer walks out of a Walgreens pharmacy store in Austin, TX, U.S., March 26, 2018. Picture taken on March 26, 2018. REUTERS/Mohammad Khursheed

Shares of the company, however, fell nearly 3 percent as the company’s international business suffered mainly due to weak demand in Britain, where its market share gains were offset by a weak retail environment.

The company operates nearly 2,500 stores in the UK, roughly half its non-U.S. stores, making it vulnerable to Brexit-related uncertainties.

“Walgreens’ overall profitability was not as strong as we would have liked. This, in our view, was due to lower demand in the United Kingdom,” Edward Jones analyst John Boylan said.

The cost-cutting program, which is expected to save more than $1 billion by the end of the third year, comes as the company consolidates 1,932 stores acquired from Rite Aid Corp RAD.N last year for $4.38 billion.

The company said its pharmaceutical wholesale division and retail businesses in Chile and Mexico were part of its cost-saving plan, which is expected to result in significant restructuring and other special charges.

International retail sales fell 5.9 percent to $2.9 billion, while same-store sales at its U.S. retail stores, where it sells over-the-counter drugs and personal care products, fell 3.2 percent.

“We were facing a tough year-ago comp number that was boosted by the impact of hurricanes and a very strong cough-cold flu season,” Chief Financial Officer James Kehoe said on a conference call.

U.S. retail sales also took a hit as the company scaled back sales of certain products including tobacco.

However, its U.S. pharmacy business posted a strong quarter, helping Walgreens beat profit estimates.

Same-store sales at its U.S. pharmacies rose 2.8 percent, beating analysts’ estimates of a 2.6 percent increase, according to IBES data from Refinitiv.

Net income attributable to the company rose to $1.12 billion, or $1.18 per share, in the first quarter ended Nov. 30 from $821 million, or 81 cents per share, a year earlier.

Excluding items, Walgreens earned $1.46 per share.

Sales rose 9.9 percent to $33.79 billion.

Analysts on average had expected a profit of $1.43 per share and revenue of $33.78 billion.