In the US, vice-admiralships and other three-star ranks are restricted by statue. There are a certain number of three-star offices, defined by law. The rank goes with the office, and is removed upon leaving office. For example, the Director of the National Security Agency is defined in law as a three-star office. A two-star admiral gains a third star when being promoted into that office. Typically, a three-star officer will retire at the end of their term in that office, rather than return to service at their lower rank. Their pension is determined by the lower rank.