#include <stdio.h>
 
#define LEN 25000
 
int Terrain(char* ascii, int len, int p, int q){
  int depth = 0, i;
  double b = 0;

  for(i = p; i < q; i++){
    if(ascii[i] == 0x2f){
      b += (double)depth - 0.5;
      depth--;
    }
    if(ascii[i] == 0x5c){
      b += (double)depth + 0.5;
      depth++;
    }
    if(ascii[i] == 0x5f){
      b += depth;
    }
  }
  return b;
}
 
 int main(){
  char ascii[LEN];
  int i, len, det;
  int sum = 0, alt = 0, pl = 0, stk = 0;
  int height[LEN] = {0}, ex[LEN] = {0};

  scanf("%s", ascii);
  for(len = 0; ; len++){
    height[len] = alt;
    if(ascii[len] == 0x2f){
      alt++;
    }
    if(ascii[len] == 0x5c){
      alt--;
    }
    if(ascii[len] == 0x0a){
      break;
    }
  }

  while(pl < len){
    while(ascii[pl] != 0x5c && pl < len){
      pl++;
    }
    det = pl+1;
    while(det <= len && height[det] != height[pl]){
      det++;
    }
    if(det <= len){
      ex[stk++] = Terrain(ascii, len, pl, det);
      pl = det;
    }else{
      pl++;
    }
  }

  for(i = 0; i < stk; i++){
    sum += ex[i];
  }

  printf("%d\n%d", sum, stk);

  for(i = 0; i < stk; i++){
    printf(" %d", ex[i]);
  }
  printf("\n");

  return 0;
}