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

typedef struct{
  int top_i;
  int top_j;
  double area;
}Stak;

int main(void){
  //posb->position(backslash),poss->position(slash)                                                                                                                                                       
  int i,j,k,len,posb,poss,bottom;
  double totalArea;
  char str[20000];
  int strPos[20002];/*now position*/
  Stak S2[10000];
  scanf("%s",str);
  len=strlen(str);
  posb=0;
  poss=0;
  strPos[0]=0;
  for(i=0,bottom=0;i<len;i++){
    if(str[i]=='\\')posb--;
    else if(str[i]=='/')poss++;
    strPos[i+1]=posb+poss;
    if(bottom>strPos[i+1])bottom=strPos[i+1];
  }
  /*calculation high of point*/
  for(i=0;i<=len;i++)
    strPos[i]-=bottom;

  /*calculation i and j*/
  for(i=0,k=0;i<=len;i++){
    if(str[i]=='\\'){
      j=i+1;

      while(1){
        if(strPos[i]==strPos[j]){
          S2[k].top_i=i;
          S2[k].top_j=j;
          i=j-1;
          k++;
          break;
        }
        j++;
        if(j>len+1)break;
      }

    }
  }
  
  for(i=0;i<k;i++){
    /*calculation area*/
    for(j=S2[i].top_i+1,S2[i].area=0;j<=S2[i].top_j;j++){

      if(str[i]=='_')S2[i].area+=strPos[S2[i].top_i]-strPos[j];

      else if(str[i]=='/' || str[i]=='\\'){
        if(strPos[S2[i].top_i]>strPos[j])
          S2[i].area+=strPos[S2[i].top_i]-strPos[j];
        else S2[i].area+=strPos[j]-strPos[S2[i].top_i];
      }

    }
  }

  for(i=0,totalArea=0;i<k;i++)
    totalArea+=S2[i].area;



  printf("%.0f\n",totalArea);
  printf("%d",k);
  if(k!=0)printf(" ");
  for(i=0;i<k;i++){
    printf("%.0f",S2[i].area);
    if(i!=k-1)printf(" ");
  }
  printf("\n");

  return 0;
}
