Calculate the total