#include <stdio.h>

struct _map {
  int  nDepth;
  char chMap;
} stMap[20000];

int chLake(int staMap, const int finMap, const struct _map* stMap, const int nDepth);

int main(){
  int maxH=0,minH=0,endMap=0;
  int A=0,L[10000],k=0;

  if (1) {
    char theMap; int m=0;
    int curH=0;
    while(scanf("%c",&theMap) !=EOF){
      stMap[m].chMap = theMap;
      if(theMap=='\\'){
	stMap[m].nDepth = --curH;
	if(curH<minH) minH=curH;
      }
      else if(theMap=='/'){
	stMap[m].nDepth = curH++;
	if(curH>maxH) maxH=curH;
      }
      else
	stMap[m].nDepth = curH;
      m++;
    }
    endMap=m;
  }

  if (1) {
    int m;
    for(m=0; m<endMap; m++) {
      if(stMap[m].chMap=='\\') {
	int n;
	for (n=m; n<endMap; n++) {
	  if ((stMap[n].chMap=='/')&&(stMap[n].nDepth==stMap[m].nDepth)) {
	    int a = chLake(m, n, stMap, stMap[m].nDepth);
	    L[k] = a/2;
	    A = A + L[k];
	    k++;
	    m = n;
	    break;
	  }
	}
      }	
    }
  }

  printf("%d\n",A);
  if (k==0)
    printf("%d\n",0);
  else {
    int l;
    printf("%d ",k);
    for(l=0; l<k-1; l++)
      printf("%d ",L[l]);
    printf("%d\n",L[k-1]);
  }
  return 0;
}

int chLake(int staMap, int endMap, const struct _map* stMap, int nDepth){
  int a=0;
  int m;
  for(m=staMap;m<=endMap;m++){
    if(stMap[m].chMap=='\\'){
      a = a + 1 + (nDepth - stMap[m].nDepth) * 2;
    }
    else if(stMap[m].chMap=='_'){
      a = a + 2 + (nDepth - stMap[m].nDepth) * 2;
    }
    else if(stMap[m].chMap=='/'){
      a = a + 1 + (nDepth - stMap[m].nDepth) * 2;
    }
  }
  return (a);
}