      subroutine monfil (iymo, root, monex, lenam)

      character*(*) monex
      character*(*) root

      common /forum/ arena
      character*8 arena

      character*6 chival, yearmo
      character*1 seprate, backsl

      logical exists, first

      parameter (backsl=char(92))

      data first/.true./

      if (first) then
        first = .false.
        seprate = '/'
      end if
      yearmo = chival(iymo)
      monex = root//yearmo(1:4)//seprate//yearmo//'.FFB'
      inquire (file=monex, exist=exists)
      if (exists) then
        lenam = len_trim(monex)
      else
        monex = root//yearmo(1:4)//seprate//yearmo//'.ffb'
        inquire (file=monex, exist=exists)
        if (exists) then
          lenam = len_trim(monex)
        else
          monex = root//yearmo(1:4)//seprate//yearmo//'.ffc'
          inquire (file=monex, exist=exists)
          if (exists) then
            lenam = len_trim(monex)
          else
            lenam = 0
          end if
        end if
      end if
      return
      end
