Savings offset many of the costs that came with hiring thousands more workers.