Deductions & credits

The original cost/purchase price.   The Mortgage or refinance doesn't figure into it.