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