How much stock can I sell and still pay 0 long term capital gains?

Lets say our AGI is about 70,000 and our taxable income is about 40,000. Can I sell $56,700 in stock ($0 cost basis) and still pay no capital gains tax or am I limited to 26,700? How do I figure this out?