#include <stdio.h>

int main(){
    int c,x,i,sum = 0,putop = 0,xtop = 0;
    int xstack[20000];
    int lefts[20000];
    int vols[20000];

    for(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(putop > 0 && last_x < lefts[putop-1]){
                new_vol += vols[--putop];
            }
            lefts[putop] = x;
            vols[putop] = new_vol;
            putop++;
        }
    }
    for(i=0; i<putop; i++){
        sum += vols[i];
    }
    
    printf("%d\n%d", sum, putop);
    
    for(i=0; i<putop; i++){
        printf(" %d", vols[i]);
    }
    puts("");
}
