#include<stdio.h>
#include<stdlib.h>
#include<string.h>
void push(int);
int pop(void);
int area(int, int, char*);

int top, S[1000];

int main(){
  int i, x, A, k=0, L[10000];
  char s[20000];

  scanf("%s",S);

  for( i = 0 ; i < strlen(s) ; i++ ){
    if( s[i] == '/' ){
      x = pop();
      if( top == 1 ){
        k++;
        L[k-1] = area(i-x, x, s);
      }
    }
    else if( s[i] == '_' ) continue;
    else  push(i);
  }

  for( i = 0 ; i < k ; i++ ){
    A += L[i];
  }

  printf("%d\n",A);
  printf("%d ",k);
  for( i = 0 ; i < k-1 ; i++ ){
    printf("%d ",L[i]);
  }
  printf("%d\n",L[k-1]);
  return 0;
}

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

int pop(){
  top--;
  return S[top+1];
}

int area(int len, int x, char* s){
  int i, h;
  double area;

  for( i = 0 ; i < len ; i++ ){
    if( s[x+i] == '_' ) area += h;
    else if( s[x+i] == '/' ){
      h--;
      area += ( 0.5 + h );
    }
    else {
      area += ( 0.5 + h );
      h++;
    }
  }
  return (int)area;
}

