#include <stdio.h>

#define LENGTH 25000

int mennseki(char *A,int l,int p,int q) {
	int h = 0,i;
	double a =0;

	for(i = p; i < q; i++) {
		if(A[i] == '/') {
			a += (double)h - 0.5;
			h--;
		} else if (A[i] == '\\') {
			a +=(double)h + 0.5;
			h++;
		} else if(A[i] =='_') {
			a += h;
		}
	}
	return a;
  }

int main() {
	char A[LENGTH];
	int i,l,dis;
	int sum=0,num=0,alt=0,j=0;
    int height[LENGTH] = {0};
	int width[LENGTH] = {0};
	scanf("%s",A);

	for(l = 0; ; l++) {
		height[l] = alt;
		if(A[l] =='/') {
			alt++;
		} else if(A[l] == '\\') {
			alt--;
		} else if(A[l] == '\0') {
			break;
		}
	}


	while(num < l) {
		while(A[num] != '\\' && num < l) {
			num++;
		}
		dis= num + 1;
		while(dis <= l && height[dis] != height[num]) {
			dis++;
		}
    if(dis <= l) {
			width[j++] = mennseki(A,l,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;
}

