PROGRAM Counting
   IMPLICIT NONE
   
   INTEGER  :: Positive, Negative, PosSum, NegSum
   INTEGER  :: TotalNumber, Count, Data

   Positive  = 0
   Negative  = 0
   PosSum    = 0
   NegSum    = 0
   READ(*,*) TotalNumber

   DO Count = 1, TotalNumber
      READ(*,*) Data
      WRITE(*,*) 'The Input ', Count,' : ', Data
      IF (Data > 0 ) THEN
         Positive = Positive + 1
         PosSum   = PosSum   + Data
      ELSE IF ( Data < 0 ) THEN
         Negative = Negative + 1
         NegSum   = NegSum   + Data
      END IF
   END DO

   WRITE(*,*) 'Counting Report:'
   WRITE(*,*) '  Positive items: ' , Positive , ' Sum = ', PosSum
   WRITE(*,*) '  Negative items: ' , Negative , ' Sum = ', NegSum
   WRITE(*,*) '  Zero Items    : ', TotalNumber - Positive - Negative
   WRITE(*,*)
   WRITE(*,*) 'The total all input is ', PosSum + NegSum

END PROGRAM Counting
