#include<stdio.h>
#include<string.h>

typedef struct Eq{
     int location ,eq;
     }S;

 int pop1();
 S pop2();
 void push1(int);
 void push2(int,int);

 int S1[20000];
 S S2[20000];

 int top1=0;
 int top2=0;

 int main(){
     int i,j,n,add,sum=0;
     char C[20000];
     scanf("%s",C);
     n=strlen(C);
     for(i=0;i<n;i++){
           if(C[i]=='\\'){
                 push1(i);
                 }
           else if(top1>0&&C[i]=='/'){
                 j=pop1();
                 add=i-j;
                 sum+=add;
                 while(top2>0&&S2[top2-1].location>j){
                       add+=pop2().eq;
                       }
                 push2(j,add);
                 }
           }
     printf("%d\n",sum);
     printf("%d",top2);
     for(i=0;i<top2;i++){
            printf(" %d",S2[i].eq);
            }
     printf("\n");
     return 0;
     }

 void push1(int i){
     S1[top1]=i;
     top1++;
     }

 int pop1(){
     top1--;
     return S1[top1];
     }

 void push2(int j,int add){
     S2[top2].location=j;
     S2[top2].eq=add;
     top2++;
     }
 
 S pop2(){
     top2--;
     return S2[top2];
     }

