#include <stdio.h>

typedef struct {
	int left;
	int right;
} pool;

int main(void)
{
	int i, j, len, k, kl, kr, le, ri, he, flag, h[20001], area[10000], areasum;
	char ch;
	pool pleft[10000], pright[10000], p[10000];
	
	h[0] = 0;
	i = 0;
	while(1) {
		scanf("%c",&ch);
		if( ch == '\n' ) break;
		switch (ch) {
		case '/':
			h[i+1] = h[i] + 1;
			break;
		case '\\':
			h[i+1] = h[i] - 1;
			break;
		case '_':
			h[i+1] = h[i];
			break;
		}
		i++;
	}
	len = i;
	
	kl = 0;
	flag = 1;
	for (i=0; i<=len-1; i++) {
		if( h[i] < h[i+1] ) {
			flag = 1;
		} else if( flag == 1 && h[i] > h[i+1] ) {
			flag = 0;
			for (j=i+1; j<=len; j++) {
				if( h[i] == h[j] ) {
					pleft[kl].left = i;
					pleft[kl].right = j;
					kl++;
					i = j - 1;
					flag = 1;
					break;
				}
			}
		}
	}
	
	kr = 0;
	flag = 1;
	for (i=len; i>=1; i--) {
		if( h[i] < h[i-1] ) {
			flag = 1;
		} else if( flag == 1 && h[i] > h[i-1] ) {
			flag = 0;
			for (j=i-1; j>=0; j--) {
				if( h[i] == h[j] ) {
					pright[kr].left = j;
					pright[kr].right = i;
					kr++;
					i = j + 1;
					flag = 1;
					break;
				}
			}
		}
	}
	
	k = 0;
	kl = 0;
	kr--;
	for (i=0; i<len; i++) {
		if( i == pleft[kl].left ) {
			p[k].left = pleft[kl].left;
			p[k].right = pleft[kl].right;
			i = pleft[kl].right - 1;
			k++;
			kl++;
			while ( i >= pright[kr].left ) {
				kr--;
			}
		} else if( i == pright[kr].left ) {
			p[k].left = pright[kr].left;
			p[k].right = pright[kr].right;
			i = pright[kr].right - 1;
			k++;
			kr--;
			while ( i >= pleft[kl].left ) {
				kl++;
			}
		}
	}
	
	areasum = 0;
	for (i=0; i<k; i++) {
		le = p[i].left;
		ri = p[i].right;
		area[i] = 0;
		he = h[le];
		for (j=le; j<ri; j++) {
			area[i] += ( he - h[j] ) + ( he - h[j+1] );
		}
		area[i] /= 2;
		areasum += area[i];
	}
	
	if( k == 0 ) {
		printf("0\n0\n");
	} else {
		printf("%d\n",areasum);
		printf("%d ",k);
		for (i=0; i<k-1; i++) {
			printf("%d ",area[i]);
		}
		printf("%d\n",area[k-1]);
	}
	
	return 0;
}