; bears to (ii) the total amount of funds apportioned to all States for metropolitan planning for fiscal year 2020. (7) Railway crossings (A) In general For the railway crossings program, an amount determined for the State under subparagraphs (B) and (C). (B) Total amount The total amount for the railway crossings program for all States shall be $245,000,000 for each of fiscal years 2022 through 2025. (C) State share (i) In general For each fiscal year, the Secretary shall distribute among the States the amount for the railway crossings program under subparagraph (B) as follows: (I) 50 percent of the amount for a fiscal year shall be apportioned to States by the formula set forth in section 104(b)(3)(A) (as in effect on the day before the date of enactment of MAP–21). (II) 50 percent of the amount for a fiscal year shall be apportioned to States in the ratio that total public railway-highway crossings in each State bears to the total of such crossings in all States. (ii) Minimum apportionment Notwithstanding clause (i), for each fiscal year, each State shall receive a minimum of one-half of 1 percent of the total amount for the railway crossings program for such fiscal year under subparagraph (B). (8) Pre-disaster mitigation program For the pre-disaster mitigation program, 2.96 percent of the amount remaining after distributing amounts under paragraphs (4), (6), and (7). (9) Carbon pollution reduction program For the carbon pollution reduction program, 3.95 percent of the amount remaining after distributing amounts under paragraphs (4), (6), and (7). (c) Calculation of amounts (1) State share For each of fiscal years 2022 through 2025, the amount for each State shall be determined as follows: (A) Initial amounts The initial amounts for each State shall be determined by multiplying— (i) the combined amount authorized for appropriation for the fiscal year for the covered programs