Whenever any officer (not exceeding five in number at any time) of the Army, Navy, Marine Corps, or Coast Guard is detailed to the Commission or the Secretary of Transportation, he shall receive from the Commission or the Secretary of Transportation, for the period during which he is so detailed, such compensation as added to his pay and allowances as an officer in such service will make his aggre