TOPOLOGICAL CHARGE FROM THERMODYNAMICS IN TWO-DIMENSIONS