Inputting and calculating total