Hello I need to sum the values of same class input in one input with class name total.
I think your issue is here:
$("#destination").val(sum);
change it to:
$(".total").val(sum);
And instead of change event i suggest you to use keyup instead.
change
keyup
$(document).on("keyup"