/*
 * 01.c
 *
 *  Created on: 2016/03/17
 *      Author: yui
 */


#include<stdio.h>
#include<string.h>
#define maxS 20  /*?????????????????§??????*/
#define maxL 20000 /*?????§??\????????????*/
#define maxP 40 /*?°´?????????????±??????°????????§*/

int main(void)
{
	struct HILL
	{
		int num;
		char state;
	};
	struct HILL x[maxS];   /*???????????????????????????????????¨???????????°??¢?????±?????\??????????????????*/

	char geo[maxL];   /*??¨????????°??¢?????±???????´???????*/
	scanf("%s", geo);

	int size[maxP][2];  /*???????????°????????????[i][0]??¨?°´?????????????????±???????±??????¢???[i][1]*/

	int i, j, k, total;
	j=0;
	k=0;
	total=0;

	for(i=0; geo[i]!='\0'; i++)
	{
		if(j==0)
		{
			x[j].num=i;
			x[j].state=geo[i];
			j++;
		}
		else if(geo[i]=='\')
		{
			x[j].num=i;
			x[j].state=geo[i];
			j++;
		}
		else if(geo[i]=='/')
		{
			if(x[j-1].state=='a')
			{
				total=total+i-x[j-1].num;
				size[k][0]=x[j-1].num;
				size[k][1]=i-x[j-1].num;
				j--; k++;
			}
			else
			{
				x[j].num=i;
				x[j].state=geo[i];
				j++;
			}
		}
	}

	int check, pond;
	check=20000;
	pond=0;  /*?°´??????????????°*/
	int each[k];  /*????°´??????????????¢???*/
	for(i=0; i<k; i++)
	{
		each[i]=0;
	}

	for(i=k-1; i>=0; i--)
	{
		if(check>size[i][0])
		{
			check=size[i][0];
			pond++;
		}
		each[pond-1]=each[pond-1]+size[i][1];
	}

	printf("%d\n%d ", total, pond);
	for(i=pond-1; i>=0; i--)
	{
		printf("%d ", each[i]);
	}

	return 0;
}