#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define N 20000

typedef struct Eq{
    int map, eq;
}s;

int s1[N], n, ad, j, sum=0;
s s2[N];
int top1=0, top2=0;
char ch[N];

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

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

void push2(int x, int add){
    s2[top2].map = x;
    s2[top2].eq = add;
    top2++;
}

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

int main(void){
    scanf("%s", ch);
    n = strlen(ch);
    for(int i=0 ; i<n ;i++){
        if(ch[i] == '\\') push1(i);
        else if(top1 > 0 && ch[i] == '/'){
            j = pop1();
            ad = i-j;
            sum +=ad;
            while( top2 > 0 && s2[top2-1].map > j) ad += pop2().eq;
            push2(j, ad);
        }
    }

    printf("%d\n", sum);
    printf("%d", top2);
    for(int i=0 ; i<top2 ; i++)
        printf(" %d", s2[i].eq);
    printf("\n");

    return 0;
}



