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

typedef struct {
    int *stk;
    int ptr;
    int size;
} Stk;

bool initStk(Stk *s, int size) {
    if((s->stk = malloc(size * sizeof(int))) == NULL) {
        return false;
    }

    s->ptr = 0;
    s->size = size;
    return true;
}

bool isStkEmpty(Stk *s) {
    return s->ptr <= 0;
}

bool isStkFull(Stk *s) {
    return s->ptr >= s->size;
}

bool pushStk(Stk *s, int x) {
    if(isStkFull(s)) {
        return false;
    }

    s->stk[s->ptr++] = x;
    return true;
}

bool popStk(Stk *s, int *x) {
    if(isStkEmpty(s)) {
        return false;
    }

    *x = s->stk[--s->ptr];
    return true;
}

void teminateStk(Stk *s) {
    free(s->stk);

    s->ptr = s->size = 0;
}

int main(void) {
    Stk stk;

    initStk(&stk, 20000);

    char buf[20000 + 1];
    fgets(buf, sizeof(buf), stdin);
    buf[strlen(buf) - 1] = '\0';

    int bPos;
    for(int i = 0; i < strlen(buf); i++) {
        switch(buf[i]) {
            case '\\':
                pushStk(&stk, i);
                break;
            case '/':
                if(!popStk(&stk, &bPos)) {
                    buf[i] = '*';
                }
            default:;
        }
    }

    for(int i = 0; !isStkEmpty(&stk); i++) {
        popStk(&stk, &bPos);
        buf[bPos] = '*';
    }

    int area[20000] = {0};
    int areaNum = 0;
    int areaSum = 0;
    int pos = 0;
    for(int i = 0; i < strlen(buf); i++) {
        switch(buf[i]) {
            case '\\':
                pushStk(&stk, pos);
                break;
            case '/':
                if(!popStk(&stk, &bPos)) {
                    break;
                }
                area[areaNum] += pos - bPos;
                areaSum += pos - bPos;
                if(isStkEmpty(&stk)) {
                    areaNum++;
                }
                break;
            case '*':
                continue;
            default:;
        }

        pos++;
    }

    printf("%d\n", areaSum);
    printf("%d", areaNum);
    if(0 < areaNum) {
        printf(" ");
    }
    for(int i = 0; i < areaNum;) {
        printf("%d", area[i]);
        i++;
        if(i < areaNum) {
            printf(" ");
        }
    }
    puts("");

    return 0;
}
