#include <stdio.h>
#include <string.h>
#define WRONG -1
#define N 20001

typedef struct{
  int index;
  int area;
}A;


int stack1[N],top1=0,top2=0,count=0;
A stack2[N];

void push1(int x){ stack1[top1++]=x; }
void push2(int g,int area){
  stack2[top2].index=g;
  stack2[top2].area=area;
  top2++;
}
int pop(){ 
  top1--;
  if(top1<0){
    top1++;   
 return WRONG;
  } 
  else 
    return stack1[top1];
}
/*int getarea(){
  int sumarea=0;
  for(int i=0;i<top2;i++){
    sumarea+=stack2[i].area;
    count++;
  }
  return sumarea;
}*/
int main(){
  char s[N];
  int g,i,j,length,area=0,area2,sumarea=0,count=0;
  
  scanf("%s",s);
  length=strlen(s);
  
  for(i=0;i<length;i++){

    if(s[i]=='\\'){
      push1(i);
    }
    else if(s[i]=='/'){
      if((g=pop())==WRONG)continue;
      area=i-g;
      for(j=top2-1;j>=0&&top2>=0;j--){
	if(g<stack2[j].index){
	  area+=stack2[j].area;
	  top2--;
	}
      }
	  push2(g,area);    
      
    }
  }
    
    for( i=0;i<top2;i++){
      sumarea+=stack2[i].area;
      count++;
    }

  

  printf("%d\n%d",sumarea,count);

  for(i=0;i<top2;i++){
    printf(" %d",stack2[i].area);
 }
  printf("\n");
 
    return 0;
  }
  

