#include <stdio.h>

#define LENGTH 25000

int mennseki(char *ascii,int length,int p,int q) {
	int hukami = 0,i;
	double a =0;
	
	for(i = p; i < q; i++) {
		if(ascii[i] == '/') {
			a += (double)hukami - 0.5;
			hukami--;
		} else if (ascii[i] == '\\') {
			a +=(double)hukami + 0.5;
			hukami++;
		} else if(ascii[i] =='_') {
			a += hukami;
		}
	}
	return a;
}

int main(void) {
	char ascii[LENGTH];
	int i,length,dis;
	int sum=0,num=0,alt=0,j=0;
    int height[LENGTH] = {0};
	int width[LENGTH] = {0};
	scanf("%s",ascii);
	
	for(length = 0; ; length++) {
		height[length] = alt;
		if(ascii[length] =='/') {
			alt++;
		} else if(ascii[length] == '\\') {
			alt--;
		} else if(ascii[length] == '\0') {
			break;
		}
	}
	    
	
	while(num < length) {
		while(ascii[num] != '\\' && num < length) {
			num++;
		}
		dis= num + 1;
		while(dis <= length && height[dis] != height[num]) {
			dis++;
		}
		if(dis <= length) {
			width[j++] = mennseki(ascii,length,num,dis);
			num = dis;
		} else {
			num++;
		}
	}
	
	for(i = 0; i <j; i++) {
		sum += width[i];
	}
	
	
	printf("%d\n%d", sum, j);
 
  for(i = 0; i < j; i++){
    printf(" %d", width[i]);
  }
  printf("\n");
 
  return 0;
}
	
		
		
