IRA earned income limit - two self-employed businesses

My wife and I are each self-employed. We file two Schedule Cs with our return (married filing jointly), one for her business, one for mine. If my business had a net profit of $3,000 and hers had a net loss of $1,000, and assuming no other earned income, what is the limit for an IRA contribution? Is it $2,000 ($3,000 profit minus $1,000 loss) or is it $3,000 (profit from my business, disregarding her loss)?

 

Thank you