Thermodynamics of the conformational transition of biopolyelectrolytes. The case of specific affinity of counterions