#include <stdio.h>
 
struct stack {
    int data[20000];
    int point;
};

int whereDownHill(struct stack *mountain);

void calculateWater(struct stack *mountain, struct stack *width);

int main(void) {
	char str[30000] = {};
	struct stack mountain = {};
	struct stack width = {};
	
	int i = 0;
	int number_puddle = 0;
	int sum_puddle = 0;
	int location_downhill = 0;

	for ( i = 0; i < 20000; i++ ) {
		mountain.data[i] = -3;
	}
	 
	fgets(str,30000, stdin);

	i = 0;
	while(str[i] != '\0' ) {
		switch(str[i]) {
			case '\\':
			    mountain.data[mountain.point] = 0;
			    mountain.point++;
			    //printf("aaaaa\n");
			    break;
			
			case '_':
			    mountain.data[mountain.point] = -1;
			    mountain.point++;
			    break;
			 
			case '/':
			    location_downhill = whereDownHill(&mountain);
			    if ( location_downhill >= 0 ) {
			        calculateWater(&mountain, &width);
			    }
				break;
			
			default:
			    break;
		}
		
		i++;
	}
	

	number_puddle = 0;
	for ( i = 0; i < mountain.point; i++ ) {
	    if ( mountain.data[i] > 0) {
	        number_puddle++;
	        sum_puddle += mountain.data[i];
	    }
	}
	printf("%d\n", sum_puddle);
	printf("%d", number_puddle);

	for ( i = 0; i < mountain.point; i++ ) {
	    if ( mountain.data[i] > 0) {
	        printf(" %d", mountain.data[i]);
	    }
	}
	printf("\n");
	 
	return 0;
}


int whereDownHill(struct stack *mountain)
{
	int point_for_search = 0;
	int location_downhill = 0;
	point_for_search = mountain -> point;
	
	while ( mountain->data[point_for_search] != 0 ) {
		point_for_search--;
		if ( point_for_search < 0  ) {
			break; 
		}
	}
	
	location_downhill = point_for_search;
	
	return location_downhill;
}


void calculateWater(struct stack *mountain, struct stack *width)
{
	int sum_width = 0;
	int sum_water = 0;

	(mountain->point)--;
	while ( (mountain->data)[mountain->point] != 0 ) {
		if ( (mountain->data)[mountain->point] > 0 ) {
			(width->point)--;
			sum_width += (width->data)[width->point];
			sum_water += (mountain->data)[mountain->point];
		} else {
			sum_width++;
		}
		(mountain->point)--;
	}
	sum_water += 1 + sum_width;
	sum_width += 2;
	(mountain->data)[mountain->point] = sum_water;
	(width->data)[width->point] = sum_width;
	(width->point)++;
	(mountain->point)++;
}
