#include <stdio.h>

#define N 30000

int main(){

  int     i;
  int     j;
  double  up=0.0;
  double  down=0.0;
  int     width=0;
  int     judge=0;
  int     count=0;
  int     sum=0;
  double  num=0.0;
  double  data[N];
  char    str[N];

    scanf("%s",str);

    data[count]=0.0;
    
    for(i=0;str[i]!='\0';i++){

      if(count>0) data[count]=0.0;
      
   
	
      if(str[i]=='\\' && judge==1){
      data[count] = data[count] + 0.50 + num;
      down++;
      }

      if(str[i]=='\\' && judge==0){
      data[count] = data[count] +  0.50 + num;
      judge=1;
      down++;
      }
      
      if(str[i]=='/' && judge==0){
	data[count] = data[count] + 0.50 + num - (down - 1.0);
      up++;
      }

      if(str[i]=='/' && judge==1){
	data[count] = data[count] + 0.50 + num - (down - 1.0);
      judge=0;
      up++;
      }

      
      if(str[i]=='_' && up !=0){
	data[count] = data[count] + 1.0 * num;
	width++;
      }

      if(str[i]=='_' && down !=0){
	data[count] = data[count] + 1.0 * num;
	width++;
      }

      if(str[i]=='_' && down == 0 && up == 0){
	width=0;
	continue;
      }

     
      
      if(up==down){
	count++;
	up = 0;
	down = 0;
	width = 0;
      }
      num = up - down;
      if(num < 0) num *= -1.0;
    }
   
    
    for(i=0;i<count;i++){
      sum += data[i];
    }

    
    printf("%d\n",sum);
    printf("%d ",count);
    for(i=0;i<count-1;i++){
    printf("%d ",(int)data[i]);  
    }
    printf("%d\n",(int)data[i]);
    
    return 0;
}
      