How to add an exact amount to the last value given in a loop