#include <stdio.h>

#define STACK_SIZE 20000
#define TOPLINEAREA STACK_SIZE - 1

void push(unsigned int line_area, unsigned int *stack, int *tail)
{
    stack[++(*tail)] = line_area; 
}

unsigned int pop(unsigned int *stack, int *tail)
{
    if(*tail < 0)
        return 0;

    return stack[(*tail)--];
}

int main(void) 
{
    int i, puddles_num = 0, puddle_area = 0, area = 0, tail = -1, line_area;
    int frontLineArea = TOPLINEAREA, backLineArea, puddle_num = 0;
    unsigned int stack[STACK_SIZE], puddles[STACK_SIZE / 2];
    char ch;

    while(scanf("%c", &ch) != EOF) {
        if(ch == '\n')
            continue;
        switch(ch) {
            case '\\':
                push(frontLineArea, stack, &tail);
                backLineArea = frontLineArea - 1;
                frontLineArea--; 
                break;

            case '/':
                if((line_area = pop(stack, &tail)) == 0) {
                    backLineArea = frontLineArea - 1;
                    frontLineArea--;
                    break;
                }
                area += (line_area - backLineArea);
                puddle_area += (line_area - backLineArea);
                backLineArea = frontLineArea - 1;
                frontLineArea--;
                break;

            case '_':
                backLineArea = frontLineArea - 1;
                frontLineArea--;
                break;
            default:
                break;
        }
        if(tail < 0 && puddle_area != 0) {
            puddles[puddles_num++] = puddle_area; 
            puddle_area = 0;
        }

        //printf("ch: %c\nfront: %d\nback: %d\nline_area: %d\narea: %d\n\n", ch, frontLineArea, backLineArea, line_area, area);
    }
    if(puddle_area)
        puddles[puddles_num++] = puddle_area;

    printf("%d\n%d", area, puddles_num);
    for(i = 0; i < puddles_num; i++)
        printf(" %d", puddles[i]);
    printf("\n");

    return 0;
}