

#include <stdio.h>
#include <stdlib.h>

struct _pond{
  int a; //area
  int s; //start
  int e; //end
};


int main(){

  int i;
	char n;
  int drop[1000];
  int pt_drop;
  struct _pond pond[1000];
  int pt_pond;
  int total;


  total=0;
	i=0; pt_drop = 0; pt_pond=0;
	while( (n=getchar()) != '\n' && n!=EOF ){
	
  	
		if( n == '/' && pt_drop > 0){ //pop
      //printf( " POP: %d\n", i );
      pt_drop--;

      total += i - drop[pt_drop];

      // current pond
      int a = i-drop[pt_drop];
      int e = i;
      int s = drop[pt_drop];

      //printf( " AREA: %d - %d =  %d\n", s, e, a );

      for( int k=pt_pond-1; k>=0; k--){
        if( s < pond[k].s ){
           //printf( " ADDING %d + %d = ", a, pond[k].a );
           // POP and update current pond
           pt_pond--;
           a = a + pond[k].a;
           //printf( "%d\n", a );
        }
      }


      // Push to stack
      pond[pt_pond].a = a;
      pond[pt_pond].s = s;
      pond[pt_pond].e = e;
      //printf( " PUSH[%d]: %d:%d:%d\n", pt_pond, pond[pt_pond].s, pond[pt_pond].e, pond[pt_pond].a );
      pt_pond++;

    }

		if( n == '\\' ){ //push
			//printf( " PUSH: %d\n", i );
      drop[pt_drop] = i;
      pt_drop++;
		}

    i++;
	}


  printf( "%d\n", total );
	
  printf( "%d%c", pt_pond, (pt_pond!=0)?' ':'\n' );

  for( int i=0; i<pt_pond; i++ )
    printf( "%d%c", pond[i].a, (i==(pt_pond-1))?'\n':' ' );  

	return 0;

}

