; or (B) build prisons, jails, or other carceral facilities, or pay for prison, jail, or other carceral facility-related improvements other than those improvements that are for the direct and primary purpose of meeting the health care needs of individuals who are incarcerated and who are eligible for medical assistance under the State Medicaid program or child health assistance or pregnancy-related assistance under the State CHIP. (4) Allocation of grant funds In determining the amount of a grant to award to a State that applies for a grant under this subsection, the Secretary shall consider the following factors, relative to other States applying for grants under this subsection: (A) The number of individuals in the State who were inmates of non-Federal public institutions (such as State prisons, local and county jails, tribal jails, and youth correctional or detention facilities) and were eligible for medical assistance under a State Medicaid program at any time in calendar year 2022. (B) The number of non-Federal public institutions in the State (such as State prisons, local and county jails, tribal jails, and youth correctional or detention facilities). (C) The State’s progress in developing, implementing, and operating initiatives to promote continuity of care for individuals who are inmates of a public institution and are eligible for medical assistance under the State Medicaid program or are eligible for child health assistance or pregnancy-related assistance under the State CHIP (with favorable consideration given to States with less progress in promoting continuity of care for such individuals). (5) Appropriation There is appropriated to the Secretary for fiscal year 2024, out of any funds in the Treasury not otherwise appropriated, $113,500,000, to remain available until expended, for the purposes of awarding and administering grants to States under this subsection. (b) Guidance to support State implementation and operations (1) In general Not later than 18 months after the date of enactment of this