#include <stdio.h>

struct stack {
	int data[20000];
	int point;
};

int main(void) {
	char str[30000] = {};
	int i = 0;
	int j = 0;
	struct stack data = {};
	struct stack width = {};
	int tmp = 0;
	int tmp1 = 0;
	int sum = 0;
	for ( i = 0; i < 20000; i++ ) {
	    data.data[i] = -3;
	}
	
	fgets(str,30000, stdin);
	i = 0;
	while(str[i] != '\0' ) {
		switch(str[i]) {
			case '\\':
				data.data[data.point] = 0;
				data.point++;
				break;
			case '_':
				data.data[data.point] = -1;
				data.point++;
				break;
			
			case '/':
			    j = data.point;
				while ( data.data[j] != 0 ) {
					j--;
					if ( j < 0 ) {
						break;
					}
				}
			    
				if ( j >= 0 ) {
					tmp = 0;
					tmp1 = 0;
					data.point--;
					while ( data.data[data.point] != 0 ) {
						if ( data.data[data.point] > 0 ) {
							width.point--;
							tmp += width.data[width.point];
							tmp1 += data.data[data.point];
						} else {
							tmp ++;
						}
						data.point--;
					}
					tmp1 += 1 + tmp;
					tmp += 2;
					data.data[data.point] = tmp1;
					width.data[width.point] = tmp;
					width.point++;
					data.point++;
				}
			default:
				break;
		}
		i++;
	}
	j = 0;
	for ( i = 0; i < data.point; i++ ) {
	    if ( data.data[i] > 0) {
    		j++;
    		sum += data.data[i];
	    }
	}
	
	printf("%d\n", sum);
	printf("%d", j);
	for ( i = 0; i < data.point; i++ ) {
	    if ( data.data[i] > 0) {
    		printf(" %d", data.data[i]);
	    }
	}
	printf("\n");
	
	return 0;
}

