Summing values over a multi line form

I have a form with multiple lines that I am creating.
I enter each line one at a time, but do not save until end.
If I have not saved these entries, and not in Db, how do I sum a value over all the records?
Is it stored in an array I can access?