#include<stdio.h>

#define MAXL 20000

typedef struct Pool {
	int position;
	int ar;
} P;
char buf[ MAXL+2 ];
int stack[ MAXL+2 ];
P ars[ 10002 ];
int sdex, adex;

int main( int argc, char *argv[] ) 
{
	int pool, sum = 0;
	int a, b;

	fgets( buf, MAXL, stdin );	
	sdex = adex = 0
	  ;
	for( a=0; '\0'!=buf[a]; a++ ) {
		if( '\\' == buf[a] ) {
			stack[ sdex++ ] = a;
		} else if( 0 < sdex && '/' == buf[a] ) {
			b = stack[ --sdex ];
			pool = a - b;
			sum += pool;
			while( 0 < adex ) {
				if( b < ars[ adex-1 ].position ) {
					pool += ars[ --adex ].ar;
				} else {
					break;
				}
			}
			ars[ adex ].position = b;
			ars[ adex++ ].ar = pool;
		}
	}
	printf( "%d\n", sum );
	printf( "%d", adex );
	
    if( 0 < adex ) printf( " " );
    for( a=0; a<adex; a++ ) {
        printf( "%d", ars[ a ].ar );
        if( a != adex-1 ) printf( " " );
    }
    printf( "\n" );
    
    
    return 0;
}

