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

#define N 30000
char dx[N];

typedef struct Roll{
  int insidedx;
  int buff;
} Roll;

int S1[N];
Roll S2[N];

int s1_top = 0;
int s1_pop()
{return S1[--s1_top];}

void s1_push(int x)
{S1[s1_top++] = x;}

int s2_top = 0;

Roll s2_Top()
{return S2[s2_top-1];}

Roll s2_pop()
{return S2[--s2_top];}

void s2_push(int insidedx, int buff)
{
  Roll x;
  x.insidedx = insidedx;
  x.buff = buff;

  S2[s2_top++] = x;
}

int main()
{
  int j,i,sum,b,c;
  scanf("%s", dx);

  sum = 0;
  i = 0;

  while ( (c = dx[i]) != 0 ) {
    if ( c == '\\' ) {
      s1_push(i);
    } else if ( s1_top > 0 && c == '/') {
      j = s1_pop();
      b = i - j;
      sum += b;
      while ( s2_top > 0 && s2_Top().insidedx > j) {
    b += s2_pop().buff;
      }
      s2_push(j, b);
    }
    i++;
  }

  printf("%d\n", sum);
  printf("%d", s2_top);
  for ( i = 0 ; i < s2_top; i++ ) {
    printf(" ");
    printf("%d", S2[i].buff);
  }
  printf("\n");

  return 0;
}