such foreign corporation, and (B) any deductions properly allocable to such portion. Any term which is used in section 245A and in this paragraph shall have the same meaning for purposes of this paragraph as when used in such section. . (e) Conforming amendments (1) Subsection (b) of section 951 is amended by striking subpart and inserting title . (2) Subsection (a) of section 957 is amended by striking subpart in the matter preceding paragraph (1) and inserting title . (3) The table of sections for part VIII of subchapter B of chapter 1 is amended by inserting after the item relating to section 245 the following new item: Sec. 245A. Dividends received by domestic corporations from certain foreign corporations. . (f) Effective date The amendments made by this section shall apply to taxable years of foreign corporations beginning after December 31, 2017, and to taxable years of United States shareholders in which or with which such taxable years of foreign corporations end. 14102. Special rules relating to sales or transfers involving specified 10-percent owned foreign corporations (a) Sales by United States persons of stock Section 1248 is amended by redesignating subsection (j) as subsection (k) and by inserting after subsection (i) the following new subsection: (j) Coordination with dividends received deduction In the case of the sale or exchange by a domestic corporation of stock in a foreign corporation held for 1 year or more, any amount received by the domestic corporation which is treated as a dividend by reason of this section shall be treated as a dividend for purposes of applying section 245A. . (b) Basis in specified 10-percent owned foreign corporation reduced by nontaxed portion of dividend for purposes of determining loss (1) In general Section 961 is amended by adding at the end the following new subsection: (d) Basis in specified 10-percent owned foreign corporation reduced by nontaxed portion of dividend for purposes of determining loss If a domestic corporation receives a dividend from a