Extract max length to variable.