#include <stdio.h>
#include <stdlib.h>

typedef struct{
    int i;
    int n;
}Mizu;

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