#include<stdio.h>
 
#define MAXLEN 20000
 
int garea,gareas[(MAXLEN/2)+1],gcnt;
 
 
int getArea( char *checkstr, int start )
{
    int i,j;
    int ravine,water,maxh;
    int down;
    
    gareas[gcnt]=water=ravine=maxh=down=0;
    for( i=start, j=0; '\0'!=*(checkstr+i) &&  j<MAXLEN; i++, j++ ) {
        if( '\\'== *(checkstr+i) ) {
            ravine++;
            water++;
            water+=((ravine-1)*2);
        } else if( 0 < ravine && '/' == *(checkstr+i) ) {
            if( maxh < ravine ) { maxh=ravine; }     
            ravine--;
            if( 0 == ravine ) {
                gareas[gcnt]+=water;
                garea+=gareas[gcnt];
                gcnt++;
                return j;
            }           
        } else {
        	if( 0 < ravine ) {
	     		gareas[gcnt]+=ravine;
	    	}
        }       
    }
 
    return 0;
}
 
void getAreas( char *inputs )
{
    int i,next;
     
    next=0;
    for( i=0; '\0'!=inputs[i]; i++ ) {
        next=getArea( 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 );
        for( i=0; i<gcnt; i++ ) {
            printf( "%d", gareas[i] );
            if( i < gcnt-1 ) {
                printf( " " );  
            } else {
                printf( "\n" ); 
            }
        }
    } else {
        printf( "0\n" );
    }
     
    return 0;
}