#include <stdio.h>

int xstack[20000];
int xtop;
int lefts[20000];
int vols[20000];
int pooltop;

int main(){
    int c;
    for(int x = 0; (c = getchar()) != '\n'; x++){
        if(c == '\\'){
            xstack[xtop++] = x;
        } else if (c == '/'){
            if(xtop == 0) continue;
            int last_x = xstack[--xtop];
            int new_vol = x - last_x;
            while(pooltop > 0 && last_x < lefts[pooltop-1]){
                new_vol += vols[--pooltop];
            }
            lefts[pooltop] = x;
            vols[pooltop] = new_vol;
            pooltop++;
        }
    }
    int sum = 0;
    for(int i=0; i<pooltop; i++){
        sum += vols[i];
    }
    printf("%d\n%d", sum, pooltop);
    for(int i=0; i<pooltop; i++){
        printf(" %d", vols[i]);
    }
    puts("");
}