We consider a linear connected-(r,s)-out-of-(m,n):F lattice system whose components are ordered like the elements of a linear (m,n)-matrix and assume that these components are in the state 1 (operating) or 0 (failed). The system fails whenever at least one connected (r,s)-submatrix of failed components occurs. The purpose of this work is to present a optimization scheme that aims at minimizing the expected cost per unit time. To find the optimal thresholds of maintenance intervention and the optimal system structure parameter (r,s), the cost optimization procedure to be employed is a simple search in the space of possible solution. The sensitivity of the results to the driving cost parameters has also been examined. Significance: The system structure design and maintenance optimizations are very important from cost and reliability point of view. We, therefore, propose here a model and approach to solving of this optimization problem for a linear connected-(r,s)-out-of-(m,n):F lattice system.