#include <stdio.h>

#define MAX 128
#define SIZE 10000

int d, top = 0, width[MAX] = {0}, dipth[MAX] = {0};
int area[SIZE] = {0}, tmpArea = 0, i = 0;

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

int addWidth(){
  for (d = 1; d <= top; d++)
    width[d]++;
  return 0;
}

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

int calculateOut(){
  if(0 < tmpArea) {
    area[i] = tmpArea;
    tmpArea = 0;
    i++;
  }
  return 0;
}

int main(void){
  char c;
  int allArea = 0, j;
  while ((c = fgetc(stdin)) != '\n') {
    switch (c) {
    case '\\':
      push(1);
      addWidth();
      break;
    case '/':
      if (isEmpty())
	break;
      addWidth();
      tmpArea += calculate();
      width[top] = 0;
      pop();
      if (!top) {
	calculateOut();
      }
      break;
    case '_':
      addWidth();
      break;
    default:
      puts("Non definition symbol!");
      break;
    }
  }
  
  if (0 < top)
    calculateOut();

  // output
  for (j = 0; j < i; j++)
    allArea += area[j];
  printf("%d\n", allArea);

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