How to add field and calculate

You will need to use a Repeater, where each line of input fields is a Repeater item.

See the following examples which show a number of techniques to achieve what you want: