I am not exactly sure how you have your HTML setup,
so I setup a form with 5 input elements.
1 - has id="answer0"
2 - has id="answer1"
3 - has id="answer2"
4 - has id="SUM"
5 - is a submit button
The first thing that happens is the window.onload event,
which runs a function that attaches the onkeyup event listener to all input elements that have the word "answer" in their id,
and assigns the function count() to the event listener.
The function count() gets the values from all three input elements and adds them together,
then places the results into the input element with id "SUM".
You shouldn't have any problems modifying this code to fit your HTML.