Thermodynamical approach to LCS ∗