#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] = {};
    int i = 0;
    int j = 0;
    struct stack mountain = {};
    struct stack width = {};
    int tmp = 0;
    int tmp1 = 0;
    int sum = 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);
                // printf("%d\n", location_downhill);
                if ( location_downhill >= 0 ) {
                    calculateWater(&mountain, &width);
                }
        		break;
        	
            default:
                break;
        }
        i++;
    }
	
	
    j = 0;
    for ( i = 0; i < mountain.point; i++ ) {
        if ( mountain.data[i] > 0) {
            j++;
            sum += mountain.data[i];
        }
    }
     
    printf("%d\n", sum);
    printf("%d", j);
    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 location_downhill = 0;
	location_downhill = mountain -> point;
	
	while ( mountain->data[location_downhill] != 0 ) {
		location_downhill--;
		if ( location_downhill < 0  ) {
			break; 
		}
	}
	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)++;
}
