The earnings and profits of a foreign corporation attributable to amounts which were included in the gross income of a United States shareholder under section
951
(a) and with respect to which an election under this section applied shall, when such earnings and profits are distributed, notwithstanding the provisions of section
959
(a)(1), be included in gross income to the extent that such earnings and profits so distributed exceed the amount of tax paid under this chapter on the amounts to which such election applied.