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


typedef struct{
	int fir;											//first
	int sec;											//second
}w;

int s[20000],  sizes = 0, sizet = 0;
w t[20000];

void push_s(int x)
{
	s[sizes++] = x;
}

int pop_s()
{
	sizes--;
	return s[sizes];
}

void push_t(int fir, int sec)
{
	w x;
	x.fir = fir;
	x.sec = sec;

	t[sizet++] = x;
}

w pop_t()
{
	sizet--;
	return t[sizet];
}

w k_t(){
	return t[sizet - 1];
}

int main(void)
{
	int i, j, sum = 0, a;
	char c[20000];

	scanf("%s", c);

	for(i = 0; i < strlen(c); i++){
		if(c[i] == '\\'){
			push_s(i);
		}
		else if(c[i] == '/' && sizes > 0){
			j = pop_s();
			sum += i - j;
			a = i - j;
			while(sizet > 0 && k_t().fir > j){
				a += pop_t().sec;
			}
			push_t(j, a);
		}
	}

	printf("%d\n", sum);
	printf("%d", sizet);

	for(i = 0; i < sizet; i++){
		printf(" ");
		printf("%d", t[i].sec);
	}

	printf("\n");
	return 0;
}

