Use the values of the input fields in a group as the value of the last input field in the group

Use the values of the input fields in a group as the value of the last input field in the group

I am trying to set the value of the last input field in a group, to equal the values of its siblings. In this scenario, users can duplicate the group.

What I have tried so far does not work properly. If user duplicates the fields, only the last group works. Any ideas on how I can achieve this?

Please see code here on fiddle.