Optimal Maintenance For a System with Required Reliability