how to calculate a percentage of a total sum