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

#define MAX 20002

typedef struct Tuple {
    int start_index;
    int area;
} Tuple;

int main(void) {
    int len;
    char input[MAX];
    scanf("%s", &input);
    len = strlen(input);
    
    int st1[MAX];
    Tuple st2[MAX];
    
    int st1_p = 0, st2_p = 0;
    int sum = 0;
    
    for (int i=0; i<len; i++) {
        if (input[i] == '\\') st1[st1_p++] = i;
        else if (input[i] == '/') {
            if (st1_p == 0) continue;
            int start = st1[--st1_p];
            int area = i - start;
            while (st2_p > 0 && st2[st2_p-1].start_index > start) {
                Tuple pop = st2[--st2_p];
                area += pop.area;
                sum -= pop.area;
            }
            Tuple t = {start, area};
            st2[st2_p++] = t;
            sum += area;
        }
    }
    
    printf("%d\n%d", sum, st2_p);
    for (int i=0; i<st2_p; i++) {
        printf(" %d", st2[i].area);
    }
    printf("\n");
}
