(a) with respect to such qualified project. (B) Allocation amount The amount determined under this paragraph with respect to a residence that is part of a qualified project and that experiences a qualified completion event is the least of— (i) the amount allocated to such project by the neighborhood homes credit agency under this section, (ii) the amount such agency determines at the time of the qualified completion event is necessary to ensure the financial feasibility of the project given the sources and uses of funds and the total financing (including local, State, and Federal subsidies) planned for the project, or (iii) in the case of a qualified completion event that occurs after the 5-year period beginning on the date of the allocation referred to in clause (i), $0. (c) Qualified development cost For purposes of this section— (1) In general The term qualified development cost means, with respect to a residence so much of the allowable development cost as the neighborhood homes credit agency certifies, at the time of the completion event— (A) meets the standards promulgated under subsection (h)(1)(C), and (B) does not represent unreasonable fees by the taxpayer claiming the credit under subsection (a). (2) Allowable development cost The term allowable development cost means— (A) the cost of construction, substantial rehabilitation, demolition of any structure, and environmental remediation, and (B) in the case of an affordable sale, so much of the cost of acquiring buildings and land as does not exceed an amount equal to 75 percent of the costs described in subparagraph (A). (3) Properties with multiple residences The allowable development cost of any residence shall include on a pro-rata basis the allowable development cost with respect to common areas or other comparable amenities. (d) Qualified project For purposes of this section, the term qualified project means a project that— (1) a neighborhood homes credit agency certifies will build or substantially rehabilitate 1 or more qualified residences