In the case of a corporation, losses from sales or exchanges of capital assets shall be allowed only to the extent of gains from such sales or exchanges.
(1) $3,000 ($1,500 in the case of a married individual filing a separate return), or
(2) the excess of such losses over such gains.