Helper function that calculates the value of each hand