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

#define MAX 20000

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

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

int pop1(){
  int x;
  x = S1[top1];
	top1--;
	return x;
}

void push2( int x ){
	top2++;
	S2[top2] = x;
}

int pop2(){
  int x;
  x = S2[top2];
	top2--;
	return x;
}

void push3( int x ){
	top3++;
	S3[top3] = x;
}

int pop3(){
  int x;
  x = S3[top3];
	top3--;
	return x;
}

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;
}

