/* AOJ (Aizu Online Judge) My Practice
 * Author: Leonardone @ NEETSDKASU
 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int stack[20001];
int sp = 0;

int main(void) {
    char temp[20010];
    int i, j, len, c, t;
    scanf("%s", temp);
    len = strlen(temp);
    for (i = 0; i < len; i++) {
        switch (temp[i]) {
        case '\\':
            stack[sp] = -i;
            sp++;
            break;
        case '/':
            c = 0;
            for (j = sp - 1; j >= 0; j--) {
                if (stack[j] > 0) {
                    c += stack[j];
                } else {
                    c += i + stack[j];
                    break;
                }
            }
            if (j >= 0) {
                stack[j] = c;
                sp = j + 1;
            }
            break;
        }
    }
    c = 0;
    t = 0;
    for (i = 0; i < sp; i++) {
        if (stack[i] > 0) {
            t += stack[i];
            c++;
        }
    }
    printf("%d\n%d", t, c);
    for (i = 0; i < sp; i++) {
        if (stack[i] > 0) {
            printf(" %d", stack[i]);
        }
    }
    puts("");
    return 0;
}