#include<stdio.h>
#include<string.h>
int main(){
  char inputdata[20001];
  int stack1[20001],Area_queue[10000],Area_stack[10000];
  int i,j,k,area_count=0,stack_count=0,len,num,total=0;

  scanf("%s",inputdata);
  len = strlen(inputdata);

  for(i=0;i<len;i++){
    if(inputdata[i] =='/' && stack_count != 0){
      Area_queue[area_count]+= i - stack1[--stack_count];
      if(stack_count == 0)area_count++;
    }
    else if(inputdata[i] =='\\'){
      stack1[stack_count++] = i;
    }
  }
  if(stack_count != 0){
    num = stack1[0];
    stack_count=0;
    j=0;
    for(i=len;i>num;i--){
      if(inputdata[i] =='/'){
	stack1[stack_count++] = i;
      }
      else if(inputdata[i] =='\\'){
	if(stack_count != 0){
	  Area_stack[j] +=stack1[--stack_count] - i;
	  if(stack_count == 0){
	    j++;
	  }
	}
      }
    }
    for(;j>0;){
      Area_queue[area_count++]=Area_stack[--j];
    }
  }
  for(i=0;i<area_count;i++)total+=Area_queue[i];
  if(area_count == 0){
    printf("0\n");
    printf("0\n");
  return 0;
  }
  printf("%d\n",total);
  printf("%d",area_count);
  for(i=0;i<area_count;i++){
    if(area_count-1 != i)printf(" %d",Area_queue[i]);
    else printf(" %d\n",Area_queue[i]);
  }
  return 0;
}
      
      
      
      

