Compute total score