The total number of officers authorized by law to be on the lineal list during a fiscal year may be temporarily exceeded so long as the average number on that list during that fiscal year does not exceed the authorized number.
33 U.S. Code § 3004 - Strength and distribution in grade
(a) Relative rank; proportionOf the total authorized number of officers on the lineal list of the commissioned corps, there are authorized numbers in permanent grade, in relative rank with officers of the Navy, in proportions as follows:
8 in the grade of captain.
14 in the grade of commander.
19 in the grade of lieutenant commander.
23 in the grade of lieutenant.
18 in the grade of ensign.
(b) Computation of number in grade
(1) In general
(c) Preservation of grade and pay, etc.
(d) Filling of vacancies; additional numbers
(e) Temporary increase in numbers