foreign income of each such deferred foreign income corporation, bears to (B) the aggregate of such United States shareholder’s pro rata share of the accumulated post-1986 deferred foreign income of all deferred foreign income corporations of such United States shareholder. (3) Definitions related to e&p deficits For purposes of this subsection— (A) Aggregate foreign e&p deficit (i) In general The term aggregate foreign E&P deficit means, with respect to any United States shareholder, the lesser of— (I) the aggregate of such shareholder’s pro rata shares of the specified E&P deficits of the E&P deficit foreign corporations of such shareholder, or (II) the amount determined under paragraph (2)(B). (ii) Allocation of deficit If the amount described in clause (i)(II) is less than the amount described in clause (i)(I), then the shareholder shall designate, in such form and manner as the Secretary determines— (I) the amount of the specified E&P deficit which is to be taken into account for each E&P deficit corporation with respect to the taxpayer, and (II) in the case of an E&P deficit corporation which has a qualified deficit (as defined in section 952), the portion (if any) of the deficit taken into account under subclause (I) which is attributable to a qualified deficit, including the qualified activities to which such portion is attributable. (B) E&p deficit foreign corporation The term E&P deficit foreign corporation means, with respect to any taxpayer, any specified foreign corporation with respect to which such taxpayer is a United States shareholder, if— (i) such specified foreign corporation has a deficit in post-1986 earnings and profits, and (ii) as of November 9, 2017— (I) such corporation was a specified foreign corporation, and (II) such taxpayer was a United States shareholder of such corporation. (C) Specified e&p deficit The term specified E&P deficit means, with respect to any E&P deficit foreign corporation, the amount of the deficit referred to in subparagraph (B). (4) Treatment of earnings and