#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int S_1[20000],S_2[20000],S_3[20000];
int cnt=0,cnt2=0,cnt3=0;
void push1(int x);
void push2(int x);
void push3(int x);
int pop1();
int pop2();
int pop3();

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

void push1(int x){
	cnt++;
	S_1[cnt] = x;
}
void push2(int x){
	cnt2++;
	S_2[cnt2] = x;
}
void push3(int x){
	cnt3++;
	S_3[cnt3] = x;
}
int pop1(){
	cnt--;
	return S_1[cnt+1];
}
int pop2(){
	cnt2--;
	return S_2[cnt2+1];
}
int pop3(){
	cnt3--;
	return S_3[cnt3+1];
}

