We purchased a new house during Jan-2018 and couple of months ago we did a solar installation. Since our roof was old our contractor suggested to replace the roof first. So we re-roofed and then installed the solar. Both roofing and solar are done by the same contractor (2 contracts). In our solar contract they did mention that we need to re-roof for the solar installation and mentioned the roofing cost and contract details.

Roofing cost: $12141
Solar cost: $11365

I was told I can deduct both roofing and solar cost. Kindly let me know how much of this can be deducted?