#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#define empty 0
/*?°´??????????????°*/
int ele=0;

/*'\'????????????????´????????§???????*/
typedef struct puddle1
{
  int pos1;

  struct puddle1 *puddle1_next;
  struct puddle1 *puddle1_prev;
} puddle1;

puddle1 *puddle1_head=NULL;
puddle1 *puddle1_last=NULL;

/*????°´????????????????????¨?????¢??????????´????????§???????*/
typedef struct puddle2
{
  int pos2;
  int size;

  struct puddle2 *puddle2_next;
  struct puddle2 *puddle2_prev;
} puddle2;

puddle2 *puddle2_head=NULL;
puddle2 *puddle2_last=NULL;


/*????????????puddle1?????????????????????????´?*/
void push1(int i)
{
  puddle1 *puddle1_new;

  puddle1_new=(puddle1*)malloc(sizeof(puddle1));
  if(puddle1_new==NULL)
    {
      printf("???????????????????????????????????§???????????¢???????¶?????????????");
      exit(EXIT_FAILURE);
      return ;
    }

  puddle1_new->pos1=i;

  puddle1_new->puddle1_next=NULL;
  puddle1_new->puddle1_prev=puddle1_last;
  puddle1_last=puddle1_new;
  if(puddle1_head==NULL)
    {
      puddle1_head=puddle1_new;
    }
}

/*????????????puddle1????????????????????????*/
int pop1(int i)
{
  puddle1 *temp;
  int z;

  if(puddle1_head==NULL)
    {
      return empty;
    }

  if(puddle1_last->puddle1_prev==NULL)
    {
      puddle1_head=NULL;
    }
  else
    {
      puddle1_last->puddle1_prev->puddle1_next=NULL;
    }

  z=puddle1_last->pos1;
  temp=puddle1_last;
  puddle1_last=puddle1_last->puddle1_prev;
  free(temp);

  return i-z;
}

/*????????????puddle2???????°´????????????????????¨??¢??????????????????*/
void push2(int i,int j)
{
  puddle2 *puddle2_new;
  puddle2_new=(puddle2*)malloc(sizeof(puddle2));
  if(puddle2_new==NULL)
    {
      printf("???????????????????????????????????§???????????¢???????¶?????????????");
      exit(EXIT_FAILURE);
      return ;
    }

  puddle2_new->size=i+j-puddle1_last->pos1;
  puddle2_new->pos2=puddle1_last->pos1;
  puddle2_new->puddle2_next=NULL;

  if(puddle2_last!=NULL)
    {
      puddle2_last->puddle2_next=puddle2_new;
      puddle2_new->puddle2_prev=puddle2_last;
      puddle2_last=puddle2_new;
    }
  else
    {
      puddle2_head=puddle2_last=puddle2_new;
      puddle2_new->puddle2_prev=NULL;
    }

  ele++;
  return ;
}

/*????????????puddle2??????????°´????????????????????¨??¢??????????????????*/
int pop2()
{
  int k=0;
  puddle2 *thisnode,*prov2;

  prov2=puddle2_last;
  for(thisnode=prov2 ; thisnode!=NULL ; thisnode=thisnode->puddle2_prev)
    {
      if(thisnode->pos2<puddle1_last->pos1)
	{
	  break;
	}

      k+=thisnode->size;
      puddle2 *temp_2;
      temp_2=puddle2_last;

      if(puddle2_last->puddle2_prev==NULL)
        {
	  puddle2_head=NULL;

	}
      else
	{
	  puddle2_last->puddle2_prev->puddle2_next=NULL;
	}

      puddle2_last=puddle2_last->puddle2_prev;
      free(temp_2);

      ele--;
    }

  return k;
}

/*????????????puddle2??????????°´????????????????????¨??¢?????????????????????????????????*/
void puddle2_func(int i)
{
  int total_2;
  if(puddle1_head==NULL)
    {
      return ;
    }

  if(puddle2_head==NULL ||puddle1_last->pos1>puddle2_last->pos2)
    {
      push2(i,0);
    }

  else if(puddle1_last->pos1<puddle2_last->pos2)
    {
      total_2=pop2();
      push2(i,total_2);
    }
  return ;
}



int main(void)
{
  char buffer[20001];
  int len;
  puddle2 *thisnode;

  fgets(buffer,sizeof(buffer),stdin);

  clock_t start,end;

  start=clock();

  len=strlen(buffer);
  int i,t,total_1=0;
  for(i=0;i<len;i++)
    {
      switch(buffer[i])
	{
	case '\\':
	  push1(i);
	  break;

	case'/':
	  puddle2_func(i);
	  t=pop1(i);
	  total_1+=t;
	  break;

	case'_':
	  break;

	}
    }

  /*?°´?????????????????¢????????°???????°´??????????????¢???*/
  printf("%d\n",total_1);
  printf("%d ",ele);
  for(thisnode=puddle2_head;thisnode!=NULL;thisnode=thisnode->puddle2_next)
    {
      printf("%d ",thisnode->size);
    }

  printf("\n");
  end=clock();
  printf("%f[s]\n",(float)(end - start)/(CLOCKS_PER_SEC));


  return 0;


}