#include<stdio.h>
 
#define SIZE 20000
 
int get_area(char* str, int len, int s, int t){
  int depth = 0, i;
  double ans = 0;
  for(i = s; i < t; i++){
    if(str[i] == '/'){
      ans += (double)depth-0.5;
      depth--;
    }
    if(str[i] == '\\'){
      ans += (double)depth+0.5;
      depth++;
    }
    if(str[i] == '_')ans += depth;
  }
  return ans;
}
 
int main(){
 
  char str[SIZE];
  int height[SIZE]={0}, vec[SIZE]={0};
  int len,h=0;
  int pos=0, cur=0, nex;
  int i,sum=0;

  scanf("%s",str);
  for(i=0;;i++){
    height[i] = h;
    if(str[i] == '/') h++;
    if(str[i] == '\\') h--;
    if(str[i] == '\0') break;
  }
  len=i;
 
  while(pos < len){
    while(str[pos] != '\\' && pos < len) pos++;
    nex = pos+1;
 
    while(nex <= len && height[nex] != height[pos]) nex++;
    if(nex <= len){
      vec[cur++] = get_area(str, len, pos, nex);
      pos = nex;
    }else{
      pos++;
    }
  }
   
  for(i = 0; i < cur; i++) sum += vec[i];
  printf("%d\n%d", sum, cur);
  for(i = 0; i < cur; i++) printf(" %d", vec[i]);
  printf("\n");
  return 0;
}