Thermodynamical properties of ultrathin layered structures