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

int s1[20000] , s2[20000] , s3[20000] , top1 = 0 , top2 = 0 , top3 = 0;

void push1(int x);
void push2(int x);
void push3(int x);
int pop1();
int pop2();
int pop3();

int main(void)
{
	char ch[20000];
	int i = 0 , j = 0 , k = 0 , sum = 0;
	scanf("%s",ch);
	
	while(ch[i] == '\\' || ch[i] == '_' || ch[i] == '/')
	{
		if(ch[i] == '\\')push1(i);
		else if(ch[i] == '/' && top1 != 0)
		{
			j = pop1();
			k = i - j;
			sum += k;
			while(top2 != 0 && j < s2[top2])
			{
				pop2();
				k += pop3();
			}
			push2(j);
			push3(k);
		}
		i++;
	}
	printf("%d\n",sum);
	printf("%d",top3);
	
	for( i = 1; top3 != 0; i++)
	{
		pop3();
		printf(" %d",s3[i]);
	}
	printf("\n");
	return 0;
}

void push1(int x){top1++;s1[top1] = x;}
void push2(int x){top2++;s2[top2] = x;}
void push3(int x){top3++;s3[top3] = x;}
int pop1(){top1--;return s1[top1+1];}
int pop2(){top2--;return s2[top2+1];}
int pop3(){top3--;return s3[top3+1];}
