case of any taxable year beginning in calendar years 2018 through 2022, the taxpayer may elect to apply this section in lieu of the deduction under section 163 for qualified residence interest. . (b) Phaseout of deduction Section 163(h) of such Code is amended by adding at the end the following new paragraph: (5) Phaseout (A) In general In the case of any taxable year beginning in a calendar year after 2017, the amount otherwise allowable as a deduction by reason of paragraph (2)(D) shall be the applicable percentage of such amount. (B) Applicable percentage For purposes of subparagraph (A), the applicable percentage shall be determined in accordance with the following table: For taxable years beginning in calendar year: The applicable percentage is: 2018 100% 2019 80% 2020 60% 2021 40% 2022 20% 2023 and thereafter 0%. . (c) Phasedown of mortgage limit Subparagraph (B) of section 163(h)(3) of such Code is amended by adding at the end the following: (iii) Phasedown (I) In general In the case of any taxable year beginning in calendar years 2018 through 2022, clause (ii) shall be applied by substituting the amounts specified in the table in subclause (II) of this clause for $1,000,000 and $500,000 , respectively. (II) Phasedown amounts For purposes of subclause (I), the amounts specified in this subclause for a taxable year shall be the amounts specified in the following table: For taxable years beginning in calendar year: Amount substituted for $1,000,000: Amount substituted for $500,000: 2018 $1,000,000 $500,000 2019 $900,000 $450,000 2020 $800,000 $400,000 2021 $700,000 $350,000 2022 $600,000 $300,000. . (d) Clerical amendment The table of sections for subpart A of part IV of subchapter A of chapter 1 of such Code is amended by inserting after section 25D the following new item: Sec. 25E. Interest on indebtedness secured by qualified residence. . (e) Effective date The amendments made by this section shall apply with respect to interest paid or accrued after December 31, 2017. 503. Deduction allowed for interest