of the stock referred to in subsection (a) as determined under section 1014(a), over (B) the adjusted basis of such stock immediately before the death of the decedent, or (2) the pro rata share (determined as of the applicable valuation date) of— (A) the aggregate fair market value of all property held by the S corporation which is of a character subject to depreciation or amortization, over (B) the aggregate adjusted basis of all such property held by the S corporation as of such date. (c) Electing S corporation For purposes of this section, the term electing S corporation means, with respect to any shareholder, any S corporation which elects the application of this section with respect to such shareholder at such time and in such form and manner as the Secretary may prescribe. (d) Applicable valuation date For purposes of this section, the term applicable valuation date means— (1) in the case of a decedent with respect to which the executor of the decedent’s estate elects the application of section 2032, the date 6 months after the decedent’s death, and (2) in the case of any other decedent, the date of the decedent’s death. (e) Accelerated deduction in case of disposition of S corporation property (1) In general If the electing S corporation disposes of any property which was taken into account under subsection (b)(2), then the deduction allowed under subsection (a) with respect to any stock, for the taxable year of the shareholder in which or with which the taxable year of the S corporation which includes the date of such disposition ends, shall (except as otherwise provided in this section) not be less than the lesser of— (A) the pro rata share of the gain recognized on such disposition, or (B) the amount determined under subsection (b)(2) by only taking into account such property. (2) Overall allowance not increased No deduction shall be allowed under subsection (a) with respect to any stock for any taxable year to the extent that such deduction (when added to the deductions so allowed for all prior