A simple beam-energy measurer for heavy ions