#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define N 20001
#define M 10000
void push(int *p, int x);
int empty();
int pop(int *p);

int n1=0,n2=0,ttp;

struct Node{
  int sum;
  int area;
};

void push1(struct Node *p, int x1,int x2);

int main()
{
  
  int n,r,i,j,str1[N],all=0;
  char sank[N];
  struct Node A[M];
  A[0].sum = -1;
  scanf("%s",sank);
  
  for(i=0; ; i++){
    if(sank[i-1]=='/' && sank[i]!='/')ttp=r;
    if(sank[i]=='\\')push(str1,i);
    else if(sank[i]=='/'){
      r=pop(str1);
      if(r!=-1)push1(A,i,r);
    }
    if(sank[i]=='\0')break;
  }

  for(j=1; j<=n2; j++)all+=A[j].area;

  printf("%d\n",all);
  
  if(n2==0)printf("%d",n2);
  else {
    printf("%d ",n2);
    for(j=1; j<=n2; j++){
      printf("%d",A[j].area);
      if(j!=n2)printf(" ");
    }
  }
  printf("\n");
  return 0;
}

void push(int *p, int x)
{
  n1=n1+1;
  p[n1]=x;
}
		   
void push1(struct Node *p, int x1,int x2)
{
  int i,res=0;

  if(p[n2].sum<x2){
    n2=n2+1;
    p[n2].sum=x2;
    p[n2].area=x1-x2;
  }
  
  else {
    p[n2].area += x1-x2;
    res = n2;
    for(i=n2-1; i>=1; i--){
      if(p[i].sum > x2){
	p[n2].area += p[i].area;
	res = i;
      }
    }
    p[res].area = p[n2].area;
    p[res].sum = p[n2].sum;
    n2 = res;
  }
}
int empty(){
  if(n1==0) return 1;
  else return 0;
}

int pop(int *p)
{
  if(empty()==1) return -1;
  else {
    n1 = n1-1;
    return p[n1+1];
  }
}


