#include <stdio.h>
#include <stdlib.h>
#define MAX 20000

typedef struct{
	int top;
	int S[MAX];
} Stack;

void initialize( Stack* );
void push( int, Stack* );
int pop( Stack* );
int isEmpty( Stack* );
int isFull( Stack* );

int main( void ){
	char c;
	int i, j, sum, tmp;
	Stack s1,s2,s3;
	
	initialize(&s1);
	initialize(&s2);
	initialize(&s3);
	
	sum = 0;
	for( i = 0; ( c = getchar()) != EOF; i++ ){
		if( c == '\\'){
			push( i, &s1 );
		}
		else if( !isEmpty(&s1) && c == '/' ){
			j = pop(&s1);
			sum += i - j;
			tmp = i - j;
			
			while( !isEmpty(&s2) && s2.S[s2.top] > j ){
				pop(&s2);
				tmp += pop(&s3);
			}
			
			push( j, &s2 );
			push( tmp, &s3 );
		}
	}
	
	printf("%d\n", sum );
	printf("%d", s3.top );
	for( i = 1; i <= s3.top; i++ ){
		printf( " %d", s3.S[i] );
	}
	printf("\n");
	
	return 0;
}

void initialize(Stack *s){
	s->top = 0;
	s->S[s->top] = 0;
}

void push( int x, Stack *s ){
	if( isFull(s)){
		exit(1);
	}
	s->S[++s->top] = x;
}

int pop(Stack *s){
	if( isEmpty(s)){
		exit(1);
	}
	
	s->top--;
	return s->S[s->top+1];
}

int isEmpty(Stack *s){
	return s->top == 0;
}

int isFull(Stack *s){
	return s->top >= MAX+1;
}
