#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 up,down;

	up=down=0;
	areas[cnt]=squre=ravine=0;
	for( i=start; '\0'!=*(areastr+i); i++ ) {
		if( '\\'== *(areastr+i) ) {
			ravine++;
			if( 0 < up ) {
				down++;
				if( up == down ) {
					areas[cnt]-=(down*down);
					areas[cnt]-=(down*2)*(maxh-ravine);
					up=down=0;
				}
			}		
		} else if( 0 < ravine && '/' == *(areastr+i) ) {
			if( 0 < down ) {
				areas[cnt]-=(down*down);
				areas[cnt]-=(down*2)*(maxh-ravine);
				up=down=0;
			}
			ravine--;
			up++;
			if( 0 == ravine ) {
				squre=(i-start+1)*maxh;
				areas[cnt]+=squre;
				areas[cnt]-=(maxh*maxh);
				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( cnt != i ) {
				printf( "\n" );	
			} else {
				printf( " " ); 
			}
		}
	} else {
		printf( "0\n" );
	}
	
	return 0;
}