Investors & landlords

Does it have to be the profit or the whole sale price including the existing loan amount for 1031 exchange

 

foe example I sell the property for 600k and the existing loan balance is 350.  So do I have invest 600k or 250k