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

int search_top(char A[],int now,int len){//水たまりの頂点を探索
	int depth=0;
	for(int i=now;i<len;i++){
		if(A[i]=='\\'){
			depth++;
		}else if(A[i]=='/'){
			depth--;
			if(depth==0){
				return (i-now+1);
			}
		}
	}
	return -1;
}


void calc(char A[]){
	int depth=0;
	int len=strlen(A);
	double *area=(double*)malloc(sizeof(double)*(len/2));
	double sum=0;
	int count=0;
	int top;

	for(int i=0;i<(len/2);i++){
		area[i]=0;
	}

	for(int i=0;i<len;i++){
		if(A[i]=='\\'){
			top=search_top(A,i,len);
			if(top>0){
				for(int j=0;j<top;j++){
					if(A[j+i]=='\\'){
						area[count]+=(depth+0.5);
						depth++;
					}else if(A[j+i]=='_'){
						area[count]+=depth;
					}else{
						depth--;
						area[count]+=(depth+0.5);
					}
				}
				count++;
				i+=top-1;
			}			
		}
	}

	for(int i=0;i<count;i++){
		sum+=area[i];
	}
	printf("%d\n",(int)sum);
	printf("%d",count);if(count==0){printf("\n");}else{printf(" ");
		for(int i=0;i<count;i++){
			printf("%d",(int)area[i]);
			if(i==(count-1)){
				printf("\n");
			}else{
				printf(" ");
			}
		}	
	}
}

int main(){

	char A[20000];
	scanf("%s",A);

	calc(A);

   return 0;
}
