Dollar gains after US consumer prices rise more than expected