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

#define MAX 20000
#define true 1
#define false 0

int top, top_P, top_A;
int Puddle[MAX];
int A[MAX];
int Stack[MAX];

int pop(){
  if(top == 0){
    exit(1);
  }
  top--;
  return Stack[top+1];
}

int pop_P(){
  if(top_P == 0){
    exit(1);
  }
  top_P--;
  return Puddle[top_P+1];
}

int pop_A(){
  if(top_A == 0){
    exit(1);
  }
  top_A--;
  return A[top_A+1];
}

void push(int x){
  top++;
  Stack[top] = x;
}

void push_P(int x){
  top_P++;
  Puddle[top_P] = x;
}

void push_A(int x){
  top_A++;
  A[top_A] = x;
}

int main(){
  char ch[MAX];
  int i, sum = 0;

  top = 0; top_P = 0; top_A = 0;
  Stack[top] = 0; Puddle[top_P] = 0; A[top_A] = 0;

  scanf("%s", ch);

  i = 0;
  while(ch[i] == '\\' || ch[i] == '/' || ch[i] == '_'){
    if(ch[i] == '\\'){
      push(i);
    }else if(ch[i] == '/' && top != 0){
      int tmp = pop();
      sum += i - tmp;
      int puddle = i - tmp;
      while(top_A != 0 && A[top_A] > tmp){
        pop_A();
        puddle += pop_P();
      }
      push_A(tmp);
      push_P(puddle);
    }
    i++;
  }

  printf("%d\n", sum);
  printf("%d", top_P);
  for(int i = 1; i <= top_P; i++){
    printf(" %d", Puddle[i]);
  }
  printf("\n");

  return 0;
}

