Thermodynamic potential for compactified bosonic strings