; and (2) by inserting after paragraph (3) the following: (4) Driving and transportation assistance allotment From the amount, if any, appropriated pursuant to subsection (h)(3) for a fiscal year, the Secretary may allot to each State with an application approved under subsection (b) for the fiscal year an amount equal to the State foster care ratio multiplied by the amount so specified. . (f) Discretionary grants Section 474 of the Social Security Act ( 42 U.S.C. 674 ) is amended— (1) by redesignating subsections (f) and (g) as subsections (g) and (h), respectively; and (2) by inserting after subsection (e) the following: (f) Discretionary grants for driving and transportation assistance From amounts appropriated pursuant to section 477(h)(3), the Secretary may make a grant to a State with a plan approved under this part, for a calendar quarter, in an amount equal to the lesser of— (1) 80 percent of the amounts expended by the State during the quarter to carry out programs for the purposes described in section 477(a)(9); or (2) the amount, if any, allotted to the State under section 477(c)(4) for the fiscal year in which the quarter occurs, reduced by the total of the amounts payable to the State under this subsection for such purposes for all prior quarters in the fiscal year. .