#include <stdio.h>

#define DSIZE 20000
#define PSIZE 10000

int top = 0, dipth[DSIZE] = {0};

typedef struct {
  int posi;
  int area;
} puddle_t;

puddle_t p[PSIZE];

int isEmpty(){
  return top == 0;
}
 
int isFull(){
  return DSIZE - 1 <= top;
}
 
int push(int posi){
  if (isFull())
    puts("over flow");
  top++;
  dipth[top] = posi;
  return 0;
}
 
int pop(){
  if (isEmpty())
    puts("under flow");
  top--;
  return dipth[top + 1];
}

int calculate(int width){
  if (width == 2)
    // triangle
    return width * 1 / 2;
  else
    // trapezoid
    return (width + width - 2) * 1 / 2;
}

int main(void){
  char c;
  int allArea = 0, posi = 0, i = 0, x, j;

  while ((c = fgetc(stdin)) != '\n') {
    switch (c) {
    case '\\':
      push(posi);
      break;
    case '/':
      if (isEmpty())
	break;
      x = pop();
      p[i].posi = x;
      p[i].area = calculate(posi + 1 - x);
      if (i == 0 || p[i - 1].posi < x)
	i++;
      else {
	for (; x < p[i - 1].posi; i--)
	  p[i - 1].area += p[i].area;
	i++;
      }
      break;
    case '_':
      break;
    default:
      puts("Non definition symbol!");
      break;
    }
    posi++;
  }
  
  // output
  for (j = 0; j < i; j++)
    allArea += p[j].area;
  printf("%d\n", allArea);

  printf("%d", i);
  for (j = 0; j < i; j++)
    printf(" %d", p[j].area);
  puts("");
  return 0;
}