      subroutine gtnorb(idebug,istats)
      implicit double precision (a-h,o-z)
      parameter (mxcol=10)
      parameter (numatm=2000)
      character*137 line,str
      common /curlin/ line
      common /orbhlp/ mxorb,iuhf,ispd
      common /moldat/ natoms, norbs, nelecs,nat(numatm)
      common /rdwr/   iun1,iun2,iun3,iun4,iun5

      istats = 1
      ist = 0

      call rewfil

      call search(line,"%molecular orbital vectors",ist)

      l = 0

      if (ist.eq.1) then
         i = 0
         do while (i.lt.3)
           l = index(line,'%')
           if (l.gt.0) then
              line = line(l+1:)
           endif
           i = i + 1
         end do
      endif

      if (l.gt.0) then
         norbs = reada(line,1,136)
      else
         norbs = 0
      endif

      return
      end

