Statistical physics of complex substitutive systems