(1) thereof— (A) first to the deductible portion (as defined in section 966(c)(3)) of the increase in subpart F income described in section 966(a)(1) included in the gross income of United States shareholders under section 951(a)(1) (after application of section 965(b)(2)(A)), (B) second to the excludable portion of the controlled foreign corporation's subpart F income, and (C) then to the amounts described in paragraph (1), (2), or (3) of subsection (c) in accordance with the provisions of subsection (c). (3) Definitions For purposes of this subsection— (A) Deductible portion The term deductible portion has the meaning given such term by section 966(c)(3). (B) Excludable portion The term excludable portion means, with respect to the subpart F income of a controlled foreign corporation, so much of such controlled foreign corporation’s modified active income as is not taken into account in computing subpart F income under section 952(a)(1). . (c) Gains and losses from the sale of CFC stock (1) Gains (A) In general Part I of subchapter P of chapter 1 is amended by adding at the end the following new section: 1203. Gains 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), there shall be excluded from gross income an amount equal to the applicable portion of the amount of any gain recognized from the sale or exchange of stock in a controlled foreign corporation. (b) Applicable portion For purposes of this section— (1) In general The term applicable portion means the amount which bears the same ratio to the gain recognized from such sale or exchange as— (A) the shareholder's pro rata share (determined under section 951(a)(2)) of the excludable portion of the aggregate 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