compute score sum