A consecutive linear (circular) [Formula: see text]-out-of-[Formula: see text]-from-[Formula: see text]: [Formula: see text] system consists of [Formula: see text] linear (circular) ordered components such that the system fails if and only if there exist a set of [Formula: see text] consecutive linear (circular) component that contains at least [Formula: see text] failed components. The optimal maintenance of the consecutive [Formula: see text]-out-of-[Formula: see text]-from-[Formula: see text]: [Formula: see text] system to linear and circular states is investigated in this paper. First, an integrated strategy of corrective maintenance and preventive maintenance is introduced. Then, for first time, optimal maintenance has been applied to these systems, and optimum maintenance time has been achieved with this strategy. Also, real-world practical examples for this system have been presented.