Don't assume the amount is simply the sum of the remaining installments.
Steps
You need to understand the mechanism for purchasing the remaining shares, the settlement, and any outstanding fees up to the exit date.
Request a written early settlement offer from the bank outlining the value of the shares and other amounts, and then weigh the decision against continuing with the loan.
The figures, fees and limits in this answer vary by bank and change over time — confirm them with your bank or the official source before acting.