#include <stdio.h>
#include <string.h>
#define LEN 20005

typedef struct {
    int idx;
    int area;
} S2;

int s1[LEN];
S2 s2[LEN];
int top1 = 0;
int top2 = 0;

void push1(int x) {
    s1[top1] = x;
    top1++;
}

int pop1(void) {
    top1--;
    return s1[top1];
}

void push2(int idx, int area) {
    s2[top2].idx = idx;
    s2[top2].area = area;
    top2++;
}

S2 pop2(void) {
    top2--;
    return s2[top2];
}

int main(void) {
    int i, j, a, tmp;
    char S[LEN];
    int sum = 0;
    scanf("%s", S);
    int n = strlen(S);
    for (i = 0; i < n; i++) {
        if (S[i] == '\\') push1(i);
        else if (S[i] == '/' && top1 > 0) {
            j = pop1();
            sum += i - j;
            a = i - j;
            while (top2 > 0 && s2[top2-1].idx > j) {
                a += pop2().area;
            }
            push2(j, a);
        }
    }
    tmp = top2;
    int ans[top2];
    for (i = top2 - 1; top2 > 0; i--) ans[i] = pop2().area;
    
    printf("%d\n%d", sum, tmp);
    for (i = 0; i < tmp; i++) printf(" %d", ans[i]);
    printf("\n");
    return 0;
}
