#include<stdio.h>
#include<stdlib.h>
typedef struct Node{
    int data;
    struct Node *next;
}node;

void push(node **ref, int data){
    node *newn = malloc(sizeof(node));
    newn->data = data;
    newn->next = (*ref);
    (*ref) = newn;
}
int pop(node **ref){
    int x = (*ref)->data;
    (*ref) = (*ref)->next;
    return x;
}
void show(node **ref){
    if((*ref)->next == NULL){
        printf("%d", (*ref)->data);
        return;
    }else{
        show(&(*ref)->next);
        printf(" %d", (*ref)->data);
    }
}

node *lefts;
node *regions;
node *volumes;

int main(){
    lefts = NULL;
    regions = NULL;
    volumes = NULL;
    node *temp;
    char c;
    int i, l, height, a, v, count;
    a = i = v = count = 0;
    while((c = getchar())!=EOF){
        if(c == '\\'){
            push(&lefts, i);
        }else if(c == '/'){
            if(lefts!= NULL){
                l = pop(&lefts);
                height = i - l;
                v += height;
                while(regions != NULL && regions->data > l){
                    height += volumes->data;
                    pop(&regions);
                    pop(&volumes);
                    count--;
                }
                push(&regions, l);
                push(&volumes, height);
                count++;
            }
        }
        i++;
    }
    printf("%d\n%d", v, count);
    if(volumes != NULL) {
        printf(" ");
        show(&volumes);
    }
    printf("\n");
    return 0;
}

