(3) Undistributed foreign earnings The term undistributed foreign earnings means the portion of the undistributed earnings which is attributable to neither— (A) income described in subparagraph (A) of section 245(a)(5), nor (B) dividends described in subparagraph (B) of such section (determined without regard to section 245(a)(12)). (d) Disallowance of foreign tax credit, etc (1) In general No credit shall be allowed under section 901 for any taxes paid or accrued (or treated as paid or accrued) with respect to any distribution any portion of which constitutes a dividend for which a deduction is allowed under this section. (2) Denial of deduction No deduction shall be allowed under this chapter for any tax for which credit is not allowable under section 901 by reason of paragraph (1) (determined by treating the taxpayer as having elected the benefits of subpart A of part III of subchapter N). (e) Special rules for hybrid dividends (1) In general Subsection (a) shall not apply to any dividend received by a United States shareholder from a controlled foreign corporation if the dividend is a hybrid dividend. (2) Hybrid dividends of tiered corporations If a controlled foreign corporation with respect to which a domestic corporation is a United States shareholder receives a hybrid dividend from any other controlled foreign corporation with respect to which such domestic corporation is also a United States shareholder, then, notwithstanding any other provision of this title— (A) the hybrid dividend shall be treated for purposes of section 951(a)(1)(A) as subpart F income of the receiving controlled foreign corporation for the taxable year of the controlled foreign corporation in which the dividend was received, and (B) the United States shareholder shall include in gross income an amount equal to the shareholder's pro rata share (determined in the same manner as under section 951(a)(2)) of the subpart F income described in subparagraph (A). (3) Denial of foreign tax credit, etc The rules of subsection (d) shall apply