#include <stdio.h>          // printf(), scanf()
#include <stdlib.h>         // exit()
#include <stdbool.h>

#define STACK_SIZE1 20000
#define STACK_SIZE2 10000

typedef struct stack2_tbl
{
	int i;
	int j;
} stack2_t;

const char NUL = '\0';
int stack1[STACK_SIZE1];
stack2_t stack2[STACK_SIZE2];
int sp1;
int sp2;

void
cleanup(int ecode)
{
	exit(ecode);
}

void
push1(int x)
{
	if (sp1 >= STACK_SIZE1)
	{
		fprintf(stderr, "Stack1 area overflow. size:%d\n", STACK_SIZE1);
		cleanup(1);
	}

	stack1[sp1++] = x;
}

void
pop1()
{
	if (sp1 <= 0)
	{
		fprintf(stderr, "Stack1 underflow #1\n");
		cleanup(1);
	}

	sp1--;
}

int
top1()
{
	if (sp1 <= 0)
	{
		fprintf(stderr, "Stack1 underflow #2\n");
		cleanup(1);
	}

	return stack1[sp1 - 1];
}

void
push2(stack2_t* s)
{
	if (sp2 >= STACK_SIZE2)
	{
		fprintf(stderr, "Stack2 area overflow. size:%d\n", STACK_SIZE2);
		cleanup(1);
	}

	stack2[sp2].i = s->i;
	stack2[sp2].j = s->j;
	sp2++;
}

void
pop2()
{
	if (sp2 <= 0)
	{
		fprintf(stderr, "Stack2 underflow #1\n");
		cleanup(1);
	}

	sp2--;
}

void
top2(stack2_t* s)
{
	if (sp2 <= 0)
	{
		fprintf(stderr, "Stack2 underflow #2\n");
		cleanup(1);
	}

	s->i = stack2[sp2 - 1].i;
	s->j = stack2[sp2 - 1].j;
}

int
main(int argc, char** argv)
{
	stack2_t s;
	int x[STACK_SIZE2];
	int i;

	sp1 = 0;
	sp2 = 0;
	int sum = 0;
	for (i = 0;; ++i)
	{
		char c;

		scanf("%c", &c);
		if (c == '\n' || c == NUL)
			break;

		if (c == '\\')
			push1(i);

		else if (c == '/' && sp1 > 0)
		{
			int j = top1(); pop1();
			sum += i - j;
			int a = i - j;
			while (true)
			{
				if (sp2 <= 0)
					break;

				top2(&s);
				if (j > s.i)
					break;

				a += s.j; pop2();
			}

			s.i = j;
			s.j = a;
			push2(&s);
		}
	}

	int n = sp2;
	for (i = sp2 - 1; sp2 > 0; --i)
	{
		top2(&s); pop2();
		x[i] = s.j;
	}

	printf("%d\n", sum);
	printf("%d", n);
	for (i = 0; i < n; ++i)
		printf(" %d", x[i]);

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