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

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

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


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

