Do you hold both liens? If so, you calculate the total outstanding principal of BOTH loans and use that figure in your calculations of the lesser total of the three options...
the unpaid principal balance / or the max amount of coverage allowable / or the replacement cost of the improved dwelling.
If you have only the 2nd, you must calculate coverage based on the aggregate unpaid balance of the 2nd line and all superior liens.
_________________________
The last thing that blew my mind was the wind.