#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define scani(x) scanf("%d",&x)
#define scanc(x) scanf("%s",x)
#define printi(x) printf("%d",x)
#define printin(x) printf("%d\n",x)
#define printc(x) printf("%s",x)
#define repd(i,n,m) for(int i = n; i > m; i--)
#define repu(i,n,m) for(int i = 0; i < m; i++)
#define allprintu(i,n,m,a) for(int i = n; i < m; i++){if(i != m-1){printf("%d ",a[i]);}else{printf("%d",a[i]);}}
#define allprintd(i,n,m,a) for(int i = n; i > m; i--){if(i != 0){printf("%d ",a[i]);}else{printf("%d\n",a[i]);}}

#define MAX 20001

int top1;
int s1[MAX];

int top2;
typedef struct{
	int first,second;
}pair;
pair s2[MAX];

void initialize(){
	top1 = 0;
	top2 = 0;
}

int isempty1(){
	return top1 == 0;
}
int isfull1(){
	return top1 >= MAX - 1;
}
int isempty2(){
	return top2 == 0;
}
int isfull2(){
	return top2 >= MAX - 1;
}
void push1(int x){
	if(isfull1()){
		exit(1);
	}
	s1[++top1] = x;
}
void push2(int first, int second){
	if(isfull2()){
		exit(1);
	}
	pair x;
	x.first = first;
	x.second = second;
	s2[++top2]= x;
}

int pop1(){
	if(isempty1()){
		exit(1);
	}
	top1--;
	return s1[top1+1];
}
pair pop2(){
	if(isempty2()){
		exit(1);
	}
	top2--;
	return s2[top2+1];
}
	
int main(void){
	int i,j,a;
	int sum = 0;
	char ch[MAX];
	pair box;
	initialize();
	scanf("%s",ch);
	for(i = 0; ch[i] != '\0'; i++){
		if(ch[i] == '\\'){
			push1(i);
		}else if(ch[i] == '/' && isempty1() == 0){
			j = pop1();
			sum += i - j;
			a = i - j;
			while(isempty2() == 0 && s2[top2].first > j){
				a += s2[top2].second;
				box = pop2();
			}
			push2(j,a);
		}
	}
	printf("%d\n",sum);
	printi(top2);
	for(int k = 1; k <= top2; k++){
		printf(" %d",s2[k].second);
	}
	printf("\n");
	return 0;
}
