#include <stdio.h>
#include <stdlib.h>
#define MAXLEN 2001

char AREA[MAXLEN] = {0};

int top;
int S[MAXLEN];

typedef struct {
	int location;
	int size;
} pool;

int top_s2;
pool S2[MAXLEN];

void initialize();
int isEmpty();
int isFull();
void push(int x);
int pop();

void initializeS2();
int isEmptyS2();
int isFullS2();
void pushS2(pool S2);
pool popS2();


int main() {
	int i, j;
	int sum, tmp;
	pool s2, tmp_s2;
	scanf("%s", AREA);
	sum = 0;
	initialize();
	initializeS2();
	for (i = 0; AREA[i] != '\0'; ++i) {
		switch(AREA[i]) {
		case '\\':
			push(i);
			break;
		case '/':
			if (isEmpty()) continue;
			j = pop();
			tmp = (i - j);
			sum += tmp;
			if (isEmptyS2()) {
				s2.location = j;
				s2.size = tmp;
				pushS2(s2);
			} else {
				tmp_s2 = popS2();
				while (tmp_s2.location > j ) {
					tmp += tmp_s2.size;
					if (isEmptyS2()) break;
					tmp_s2 = popS2();
				}
				if (tmp_s2.location < j) {
					pushS2(tmp_s2);
				}
				s2.location = j;
				s2.size =  tmp;
				pushS2(s2);
			}
			break;
		case '_':
			break;
		}
	}
	printf("%d\n", sum);
	j = 0;
	//s2 = popS2();
	//S[0] = s2.size;

	while (!isEmptyS2()) {
		s2 = popS2();
		S[j] = s2.size;
		++j;
	}
	if (j) {
		printf("%d ", j);
	} else {
		printf("%d\n", j);
	}
	for (i = 0; i < j; ++i) {
		if (i != j - 1) {
			printf("%d ", S[j-1-i]);
		} else {
			printf("%d\n", S[j - 1 - i]);
		}
	}
	return 0;
}

void initialize() {
	top = 0;
	return;
}

int isEmpty() {
	return top == 0;
}

int isFull() {
	return top >= MAXLEN - 1;
}

void push(int x) {
	if (isFull()) {
		printf("Over Flow\n");
		exit(-1);
	}

	top++;
	S[top] = x;
}

int pop() {
	if (isEmpty()) {
		exit(-1);
	}
	top--;
	return S[top+1];
}


void initializeS2() {
	top_s2 = 0;
	return;
}

int isEmptyS2() {
	return top_s2 == 0;
}

int isFullS2() {
	return top_s2 >= MAXLEN - 1;
}

void pushS2(pool new) {
	if (isFullS2()) {
		printf("Over Flow S2\n");
		exit(-1);
	}
//	printf("new %d %d %d\n", new.location, new.size, top_s2);
	top_s2++;
	S2[top_s2] = new;
}

pool popS2() {
	if (isEmptyS2()) {
		printf("Under Flow S2\n");
	}
	top_s2--;
	return S2[top_s2+1];
}