Investors & landlords

The deduction is limited to the net investment income, not necessarily the net gain because there are interest and dividends that have to be added to the net gain to arrive at net investment income as well. But my question is basically if you have a large net capital loss (e.g., $20,000), would line 4d/e be $0, -$3000, or -$20,000?