subpart F income of the controlled foreign corporation for the applicable period, bears to (B) the sum of the amount determined under subparagraph (A) plus the shareholder's pro rata share (determined under section 951(a)(2)) of the aggregate subpart F income of the controlled foreign corporation for the applicable period. (2) Excludable portion For purposes of this section, the term excludable portion has the meaning given such term by section 959(g)(3)(B). (3) Applicable period The term applicable period means, with respect to any stock, the shorter of the 3-taxable-year period immediately preceding the taxable year of the sale or exchange or the shareholder's holding period in the stock. In no event shall the applicable period include any portion of any taxable year beginning before the applicable date (as defined in section 300 of the Infrastructure 2.0 Act ). . (B) Clerical amendment The table of sections for part I of subchapter P of chapter 1 is amended by adding at the end the following new item: Sec. 1203. Gains from sales or exchanges of stock in controlled foreign corporations. . (2) Losses (A) In general Part II of subchapter P of chapter 1 is amended by adding at the end the following new section: 1213. Losses from sales or exchanges of stock in controlled foreign corporations (a) In general In the case of a United States shareholder (as defined in section 951), any loss from the sale or exchange of stock in a controlled foreign corporation shall be reduced (but not below zero) by an amount equal to the shareholder's aggregate pro rata share (determined under section 951(a)(2)) of the excludable portion of the subpart F income of the controlled foreign corporation during the shareholder's holding period in the stock. (b) Excludable portion For purposes of this section, the term excludable portion has the meaning given such term by section 959(g)(3)(B). . (B) Clerical amendment The table of sections for part I of subchapter P of chapter 1 is amended by adding at the end the following new item: Sec.