#include <stdio.h>

int last;
char map[40000][20000];

int existPool(int,int);
int getArea(int,int,int);
void setNext(int* i,int* j);

int main(){
  int tmp, i = 19999, j = 0, k = 0;
  int pool[10000], n = 0;
  char pre, s[20000], c;

  //input

  scanf("%s",s);
  map[i][j] = s[k++];
  pre = map[i][j];
  
  while( (c = s[k++]) != '\0'){
    if(pre == '/'){
      if(c == '\\')j++;
      else{ i--; j++; }
    }

    else if(pre == '\\'){
      if(c == '\\'){ i++; j++; }
      else j++;
    }

    else{
      if(c == '\\'){ i++; j++; }
      else j++;
    }
    
    map[i][j] = c;
    pre = c;
  }

  //simulation
  
  last = j+1;
  i = 19999;
  
  for(j = 0; j < last; j++){
    
    if(map[i][j] == '\\'){
      tmp = existPool(i,j);
      if(tmp > j){
	pool[n] = getArea(i,j,tmp);
	n++;
	k = tmp;
	setNext(&i,&k);
	j = tmp;
      }
      
      else{
	k = j;
	setNext(&i,&k);
      }
    }
    
    else{
      k = j;
      setNext(&i,&k);
    }
    
  }

  //output

  tmp = 0;
  for(i = 0; i < n; i++){
    tmp += pool[i];
  }

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

  return 0;
}

int existPool(int y, int x){
  int j = x, result = 0;
  
  while(1){
    j++;
    if(map[y][j] == '/'){
      result = 1;
      break;
    }
    if(j >= last-1) break;
  }

  if(result) return j;
  else return x;
}

int getArea(int y, int x0,int xt){
  int i = y, j, k, result = 0, harf = 0;

  for(j = x0; j <= xt; j++){
    if( (map[i][j] == '\\') || (map[i][j] == '/') ){
      result += (i-y);
      harf++;
    }
    else{
      result += (i-y+1);
    }

    k = j;
    setNext(&i,&k);
  }

  result += (harf/2);

  return result;
}

void setNext(int* i, int* j){
  int x, y;

  y = *i;
  x = *j;

    if(map[y][x] == '\\'){
      if(map[y+1][x+1] == '\\'){
	y++;
	x++;
      }
      else x++;
    }
    
    else if(map[y][x] == '/'){
      if(map[y][x+1] == '\\') x++;
      else{
	y--;
	x++;
      }
    }

    else{
      if(map[y+1][x+1] == '\\'){
	y++;
	x++;
      }
      else x++;
    }

    *i = y;
    *j = x;
  
}
