/* ALDS1_3D: Areas on the Cross-Section Diagram */
/* 20181115 AOJ */

#define _CRT_SECURE_NO_WARNINGS

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

void push(int m);
int pop();

#define N 20000
int top, stack[N];
typedef struct {
	int position;
	int area;
} Unit;

Unit unit[N/2];

int main(void){
	int sumArea = 0, i = -1, j = 0, k, pool = 0;
	char S[N];
	
	scanf("%s", S);
	while(S[++i]){
		if(S[i] == '\\'){
			push(i);
		}else if(S[i] == '/' && top ){
			k = pop();
			pool = i - k;
			sumArea += pool;
			while(j > 0){
				if(unit[j - 1].position > k){
					pool += unit[--j].area;
				}else{
					break;
				}
			}

			unit[j].position = k;
			unit[j++].area = pool;
		}else{
			/* Do Nothing */
		}
	}


	printf("%d\n%d", sumArea, j);
	
	for(i = 0; i < j; i++){
		printf(" %d", unit[i].area);
	}
	printf("\n");

	return 0;
}

void push(int m){
	stack[top++] = m;
}

int pop(){	
	return stack[--top];
}

