calculate totalscore