      program mavg

      character cline * 80

      do  n = 1, 7
        read(*,'(a80)') cline
      enddo

      rmsum = 0.0
      nm    = 0

      do  n = 1, 1000
        read(*,*,end=10) x, rm
        if ( x .ge. 0.2 ) then
          rmsum = rmsum + rm
          nm    = nm + 1
        endif
      enddo

  10  continue

      rmavg = rmsum / nm
      write(*,*) 'rmavg = ', rmavg

      stop
      end
