Calculating the amount of substances in an equilibrium mixture