#include<stdio.h>
#include<string.h>
#include<math.h>
typedef struct{
  int maxi;
  int maxj;
  double menseki;
}L;
int main(){
  int i,j,n,m=0,sump=0,summ=0,min,SS[20001],k=0,sum=0;
  char S[20000];
  L LL[10000];
  scanf("%s",S);
  n=strlen(S);
  min=0;
  SS[0]=0;
  for(i=0;i<n;i++){
    if(S[i]=='/')sump++;
    if(S[i]=='\\')summ--;
    SS[i+1]=sump+summ;
    if(min>SS[i+1]){
      min=SS[i+1];
    }
  }
  for(i=0;i<n+1;i++){
    SS[i]-=min;
  }
  for(i=0;i<n+1;i++){
    if(S[i]=='\\'){
      j=i+1;
      while(1){
	if(SS[i]==SS[j]){
	  LL[m].maxi=i;
	  LL[m].maxj=j;
	  m++;
	  i=j-1;
	  break;
	};
	j++;
	if(j==n+1)break;
      }
    }
  }
  
  for(i=0;i<m;i++){
    for(j=LL[i].maxi;j<LL[i].maxj;j++){
      if(S[j]=='\\' || S[j]=='/'){
	LL[i].menseki+=(1/2+fabs(SS[LL[i].maxi]-SS[j]));
      }
      if(S[j]=='_'){
        LL[i].menseki+=SS[LL[i].maxi]-SS[j];
      }
    }
  }
  for(i=0;i<m;i++){
    sum+=LL[i].menseki;
  }

  printf("%d\n%d",sum,m);
  for(i=0;i<m;i++){
    printf(" %d",(int)LL[i].menseki);
  }
  printf("\n");
  return 0;
}