#include<stdio.h>
 
#define MAXLEN 20000
 
int garea,gareas[(MAXLEN/2)+1],gcnt;
 
 
int getArea( char *inputs, int start, int end )
{
    int i;
    int ravine,water;
    
    gareas[gcnt]=water=ravine=0;
    for( i=start; i<=end && '\0'!=*(inputs+i) ; i++ ) {
        if( '\\'== *(inputs+i) ) {
            water+=(ravine*2);
            ravine++;
            water++;
        } else if( 0 < ravine && '/' == *(inputs+i) ) {   
            ravine--;
            if( 0 == ravine ) {
                gareas[gcnt]+=water;
                break;
            }           
        } else {
	     	gareas[gcnt]+=ravine;
        }       
    }
 
    return gareas[gcnt];
}
  
int checkRavine( char *inputs, int start )
{
    int i,j;
    int ravine;
    
    ravine=0;
    for( i=start, j=0; '\0'!=*(inputs+i) && j<MAXLEN; i++, j++ ) {
        if( '\\'== *(inputs+i) ) {
            ravine++;
        } else if( 0 < ravine && '/' == *(inputs+i) ) {   
            ravine--;
            if( 0 == ravine ) {
            	garea+=getArea( inputs, start, i );
            	gcnt++;
                return j;
            }           
        }
    }
    return 0;
}
 
 
void getAreas( char *inputs )
{
    int i,next;
     
    next=0;
    for( i=0; '\0'!=inputs[i]; i++ ) {
        next=checkRavine( inputs, i );
        i+=next;
    }
 
    return;
}
 
int main( void ) 
{
    char inputs[MAXLEN+1];
    int i;
 
    scanf( "%s", inputs );
    garea=gcnt=0;
    getAreas( inputs );
     
    printf( "%d\n", garea );
    
    if( gcnt ) {
        printf( "%d ", gcnt );
        gcnt--;
        for( i=0; i<=gcnt; i++ ) {
            printf( "%d", gareas[i] );
            if( i < gcnt ) {
                printf( " " );  
            } else {
            	printf( "\n" ); 
            }
        }
    } else {
        printf( "0\n" );
    }
     
    return 0;
}