#include<stdio.h>
#define LEN 20001
#define AREA 10001

typedef struct Distritc{
    int j;
    int s;
}distritc;

int main(void){
    int i, j = 0, k = 0, s, sum = 0;
    char slash;
    int s1[LEN];
    distritc s2[AREA];
    
    for(i = 0; scanf("%c", &slash) != EOF; i++){
        if(slash == '\\') s1[j++] = i;
        else if(slash == '/' && j > 0){
            s = i - s1[--j];
            sum += s;
            
            while(k > 0 && s2[k - 1].j > j){s += s2[--k].s;}
            s2[k].j = j; s2[k++].s = s;
        }
    }
    
    printf("%d\n", sum);
	if(!k) printf("%d\n", k);
	else printf("%d", k);
    for(i = 0; i < k; i++) {
        printf(" %d", s2[i].s);
        if(i == k - 1)printf("\n");
    };
    
    
    return 0;
}
