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

#define MAX 20000

static int top = 0;
static int stack[MAX];

void push(int x);
int pop(void);
int isEmpty(void);
int isFull(void);

int main(void){
  int l[MAX/2][2], k = 0, A = 0;
  int i, tmp;
  char str[MAX+1];

  scanf("%s", str);
  for(i = 0; str[i] != '\0'; i++){
    switch(str[i]){
    case '\\':
      push(i);
      break;
    case '_':
      break;
    case '/':
      tmp = pop();
      if(tmp != -1){
	A += i-tmp;
	l[k][0] = i-tmp;
	l[k][1] = tmp;
	while(k > 0 && l[k][1] < l[k-1][1]){
	  l[k-1][0] += l[k][0];
	  l[k-1][1] = l[k][1];
	  k--;
	}
	k++;
      }
      break;
    }
  }
  
  printf("%d\n", A);
  printf("%d", k);
  for(i = 0; i < k; i++){
    printf(" %d", l[i][0]);
  }
  printf("\n");
  return 0;
}


void push(int x){
  if(isFull()){
    printf("?????????????????????\n");
    exit(1);
  }
  stack[++top] = x;
}


int pop(void){
  if(isEmpty()){
    /*
    printf("??¢??????????????????\n");
    exit(1);
    */
    return -1;
  }
  return stack[top--];
}


int isEmpty(void){
  return top == 0;
}


int isFull(void){
  return top >= MAX-1;
}