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

#define N 20001
#define L 10000



int n1=0,n2=0,ttp;

struct Node{
  int sum;
  int area;
};

void push(int *p, int n)
{
  n1=n1+1;
  p[n1]=n;
}

void push1(struct Node *p, int x,int y)
{
  int i,res=0;

  if(p[n2].sum<y){
    n2=n2+1;
    p[n2].sum=y;
    p[n2].area=x-y;
  }

  else {
    p[n2].area += x-y;
    res = n2;
    for(i=n2-1; i>=1; i--){
      if(p[i].sum > y){
	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 *a)
{
  if(empty()==1) return -1;
  else {
    n1 = n1-1;
    return a[n1+1];
  }
}

int main()
{

  int i,j,a,n,r,str1[N];

  char sank[N];

  struct Node A[L];

  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++)a+=A[j].area;

  printf("%d\n",a);

  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;
}

