Whenever two or more counties acting together shall erect any such institution they shall bear the expenses of establishing and maintaining such institution as follows: The original cost of the site and buildings of the institution and all additions thereto, and all fixed overhead charges in conducting the institution, shall be paid by the said counties in the ratio of their population according to the last preceding United States census. The cost of the care and maintenance of the inmates shall be certified monthly to the counties from which inmates have been committed. Such cost shall be paid by the counties establishing such institution, in proportion to the number of inmates committed from each county. All payments shall be on requisition of the authorities in charge of such institution and on warrant of the county commissioners countersigned by the county controller: Provided, however, That nothing in this section shall prevent the counties from agreeing to a different basis for apportioning the expenses.
16 P.S. § 8123