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

typedef struct _data {
	int val;
	int ceil;
	struct _data *next;
} data;

void push(data **p, data *d)
{
	d->next = *p;
	*p = d;
}

data *pop(data **p)
{
	if (*p == NULL) return NULL;
	data *d = *p;
	*p = (*p)->next;
	return d;
}

int main()
{
	char str[20001], ch;
	int i, val, ceil, total, count;
	data *w1, *w2, *d;

	scanf("%s", str);
	i = 0;
	w1 = w2 = NULL;
	while ((ch = str[i++]) != '\0')
	{
		if (ch == '\\')
		{
			d = (data*)malloc(sizeof(data));
			d->val = 0;
			d->ceil = 0;
			push(&w1, d);
		}
		else if (ch == '_')
		{
			d = pop(&w1);
			if (d == NULL) continue;
			d->ceil++;
			push(&w1, d);
		}
		else
		{
			val = ceil = 0;
			while ((d = pop(&w1)) != NULL)
			{
				val += d->val;
				ceil += d->ceil;
				if (d->val == 0) break;
				push(&w2,d);
			}

			if (d != NULL)
			{
				d->val = val + ceil + 1;
				d->ceil = ceil + 2;
				push(&w1, d);
				while ((d = pop(&w2)) != NULL) free(d);
			}
			else if (val > 0)
			{
				while ((d = pop(&w2)) != NULL) push(&w1, d);
			}
		}
	}

	total = count = 0;
	while ((d = pop(&w1)) != NULL)
	{
		if (d->val == 0)
		{
			free(d);
			continue;
		}

		total += d->val;
		count++;
		push(&w2, d);
	}

	printf("%d\n", total);
	printf("%d", count);
	if (count)
	{
		printf(" ");
		for (i = 0; i < count; i++)
		{
			d = pop(&w2);
			printf("%d", d->val);
			free(d);
			if (i + 1 < count) printf(" ");
		}
	}
	printf("\n");

	return 0;
}