      subroutine MNLN(NUMB,LENS,MINS,STRING,STRSIZ)
      include 'UNITS.INC'
      integer NUMB,LENS(NUMB),MINS(NUMB),I,INDEXI
      integer MINI,MAXK,INDEXJ,J,MINK,MINJ,L,ADD,STRSIZ
      character STRING(STRSIZ)*1
      INDEXI = 0
      do 130 I = 1, NUMB
         if (I.ne.1) INDEXI = INDEXI+LENS(I-1)
         MINI = LENS(I)
         MAXK = -1
         INDEXJ = 0
         do 120 J = 1, NUMB
            if (J.ne.1) INDEXJ = INDEXJ+LENS(J-1)
            if (I.eq.J) go to 120
            MINK = MINI
            MINJ = LENS(J)
            if (MINJ.lt.MINK) MINK = MINJ
            do 100 L = 1, MINK
               if (STRING(INDEXI+L).ne.STRING(INDEXJ+L)) go to 110
100         continue
            if (MINI.eq.MINJ) then
               write (PRINTR(MACHNO),5000) I,J
5000           format (/1X,'Strings ',I3,' and ',I3,' are duplicate.')
               stop
            endif
            ADD = 0
            if (MINJ.lt.MINI) ADD = 1
            MAXK = MINK+ADD
            go to 120
110         continue
            if (L.gt.MAXK) MAXK = L
120      continue
         MINS(I) = MAXK
130   continue
      return
      end
