      SUBROUTINE MAIN
      INTEGER GETARG, OPEN, DITOC
      LOGICAL*1 BUF(512), GETCH, C
      INTEGER I, NC(2), INT
      CALL QUERY(23Husage:  ccnt [file] ...)
      NC(1) = 0
      NC(2) = 0
      I=1
23000 CONTINUE
      IF (.NOT.(GETARG(I, BUF, 512) .EQ. -1))GOTO 23003
      IF (.NOT.(I .EQ. 1))GOTO 23005
23007 IF (.NOT.(GETCH(C, 1) .NE. -1))GOTO 23008
      NC(2) = NC(2) + 1
      IF (.NOT.(NC(2) .GE. 10000))GOTO 23009
      NC(1) = NC(1) + 1
      NC(2) = 0
23009 CONTINUE
      GOTO 23007
23008 CONTINUE
23005 CONTINUE
      GOTO 23002
23003 CONTINUE
      IF (.NOT.(BUF(1) .EQ. 45 .AND. BUF(2) .EQ. 0))GOTO 23011
23013 IF (.NOT.(GETCH(C, 1) .NE. -1))GOTO 23014
      NC(2) = NC(2) + 1
      IF (.NOT.(NC(2) .GE. 10000))GOTO 23015
      NC(1) = NC(1) + 1
      NC(2) = 0
23015 CONTINUE
      GOTO 23013
23014 CONTINUE
      GOTO 23012
23011 CONTINUE
      INT = OPEN(BUF, 1)
      IF (.NOT.(INT .EQ. -3))GOTO 23017
      CALL CANT(BUF)
23017 CONTINUE
23019 IF (.NOT.(GETCH(C, INT) .NE. -1))GOTO 23020
      NC(2) = NC(2) + 1
      IF (.NOT.(NC(2) .GE. 10000))GOTO 23021
      NC(1) = NC(1) + 1
      NC(2) = 0
23021 CONTINUE
      GOTO 23019
23020 CONTINUE
      CALL CLOSE(INT)
23012 CONTINUE
23004 CONTINUE
23001 I=I+1
      GOTO 23000
23002 CONTINUE
      I = DITOC(NC, BUF, 20)
      CALL PUTLIN(BUF, 2)
      CALL PUTCH(10,2)
      RETURN
      END
