This paper addresses the problem of finding the optimum length for the adaptive least mean square (LMS) filter. In almost all papers published in this field, the length of the adaptive filter is maintained constant and the values of the coefficients are modified such that the output mean squared error (MSE) is minimized. There are some practical applications where we need to have information about the length of the optimum Wiener solution. As an example in system identification, one needs to have not only accurate approximation of the coefficient values but also the number of the coefficients of the unknown system. Here we provide the theoretical analysis of the LMS algorithm where the length mismatch between the adaptive filter and the unknown filter is taken into account. Based on this theoretical analysis a new variable length LMS algorithm is introduced.