Dimension formulas for modules finite over local homomorphisms