#include<stdio.h>
#include<stdlib.h>

#define MAX 20000

void push1( int x );
int pop1();
void push2( int x );
int pop2();
void push3( int x );
int pop3();

int top1=0,top2=0,top3=0;
int S1[MAX];
int S2[MAX];
int S3[MAX];

int main( void ){
	
	int i = 0;
	int j;
	char s[MAX];
	int total = 0;
	int ans = 0;
	
	scanf("%s",s);
	
	while( s[i]=='\\' || s[i]=='/' || s[i]=='_' ){
		
		if( s[i] == '\\' ){
			push1(i);
		}else if( ( s[i] == '/' ) && ( top1 != 0 ) ){
			j = pop1();
			total = i - j;
			ans += total;
			
			while( ( top2 != 0 ) && ( j <= S2[top2] ) ){
				
				pop2();
				total+=pop3();
			}
			
			push2(j);
			push3(total);
		}
		
		i++;
	}
	
	printf( "%d\n" , ans );
	printf( "%d" , top3 );
	
	for( i = 1; top3 != 0 ; i++ ){
		
		pop3();
		printf( " %d" , S3[i] );
		
	}
	
	printf( "\n" );
	
	return 0;
}

void push1( int x ){
	top1++;
	S1[top1] = x;
}

int pop1(){
	top1--;
	return S1[top1+1];
}
	
void push2( int x ){
	top2++;
	S2[top2] = x;
}

int pop2(){
	top2--;
	return S2[top2+1];	
}
	
void push3( int x ){
	top3++;
	S3[top3] = x;
}

int pop3(){
	top3--;
	return S3[top3+1];
}

