Obtaining salts in reactions of acids with metals