#include <stdio.h>
 
struct pair {
  int x;
  int ar;
};
int top_stack1 = 0, top_stack2 = 0;
int stack1[20000];
struct pair stack2[20000];
  
void push_stack1(int x) {
  stack1[top_stack1] = x;
  top_stack1++;
}
 
void push_stack2(int j, int a) {
  stack2[top_stack2].x = j;
  stack2[top_stack2].ar = a;
  top_stack2++;
}
 
int pop_stack1(void) {
  int r = 0;
 
  top_stack1--;
   
  if(top_stack1 < 0) {
    top_stack1 = 0;
    return 0;
  }
  r = stack1[top_stack1];
  return r;
 
}
 
struct pair pop_stack2(void) {
  struct pair s;
 
  top_stack2--;
   
  if(top_stack2 < 0) {
    top_stack2 = 0;
    return;
  }
  s = stack2[top_stack2];
  return s;
 
}
int main() {
  int i, j;
  int sum = 0, a;
  struct pair c;
  char input[20000];
 

  scanf("%s", input);

  for (i = 0; input[i] != '\0'; i++) {
    if(input[i] == '\\') push_stack1(i);
    else if((input[i] == '/') && (top_stack1 > 0)) {
      j = pop_stack1();
      sum += i - j;
      a = i - j;
      while ((top_stack2 > 0) && stack2[top_stack2 - 1].x > j) {
        a += stack2[top_stack2 - 1].ar ;
        c = pop_stack2();
      }
      push_stack2(j, a);
    }
  }

  printf("%d\n", sum);
  printf("%d", top_stack2);
  for(i = 0; i < top_stack2; i++) {
    if(i < top_stack2) printf(" ");
    printf("%d", stack2[i].ar);
  }
  printf("\n");
 
 
  return 0;
}
