#include<stdio.h>
#include<string.h>
#define MAX 20000

typedef struct Data{
  int area,pos;
}Data;

void D_push();
Data D_pop();
void push(int );
int pop();
void init();

Data makeData(int x, int y){
  Data res;
  res.area = x;
  res.pos = y;
  return res;
}

Data t[MAX];
int u[MAX];
int n,i;
char str[MAX+1];
int ans,A,T,U;
Data B,X;

int main(){
  init();
  scanf("%s",str);
  n = strlen(str);
  for(i = 0;i<n;i++){
    if(str[i] == '/'){
      if( U == 0)continue;
      A = pop();
      X = makeData(i-A,A);
      ans = ans +i -A;
      while(T > 0){
	B = D_pop();
	if(B.pos <A){
	  D_push(B);
	  break;
	}
	X.area += B.area;
	if(B.pos<X.pos){
	  X.pos = B.pos;
	}
      }
	D_push(X);
      }
      else if(str[i] == '\\'){
	push(i);
      }
    }
    printf("%d\n%d",ans,T);
    
    for(i = 0; i<T; i++){
      printf(" %d",t[i].area);
    }
    printf("\n");
    return 0;
  }

void D_push(Data data){
  t[T++] = data;
}

Data D_pop(){
  return t[--T];
}

void push(int x){
  u[U++] = x;
}

int pop(){
  return u[--U];
}

void init(){
  ans = T = U = 0;
}

