#include <stdio.h>
#include <string.h>

int min(int x, int y) { return x < y ? x : y; }
int max(int x, int y) { return x > y ? x : y; }

int area_type(char c)
{
	switch(c)
	{
		case '\\':
			return -1;
		
		case '/':
			return +1;
	}
	return 0;
}

int main()
{
	int  n, m, tmp, ans;
	int  a[10000];
	int  w[20001];
	int  g[20001];
	char s[20001];
	
	scanf("%s", s);
	n = strlen(s);
	
	g[0] = 0;
	for(int i = 0; i < n; ++i)
	{
		g[i+1] = g[i] + area_type(s[i]);
	}
	
	tmp = w[0] = g[0];
	for(int i = 1; i <= n; ++i)
	{
		tmp = max(tmp, g[i]);
		w[i] = tmp;
	}
	
	tmp = w[n] = g[n];
	for(int i = n-1; i >= 0; --i)
	{
		tmp = max(tmp, g[i]);
		w[i] = min(w[i], tmp);
	}
	
	tmp = ans = m = 0;
	for(int i = 1; i <= n; ++i)
	{
		tmp += (w[i-1]-g[i-1])+(w[i]-g[i]);
		if((w[i] == g[i]) && tmp)
		{
			tmp /= 2;
			ans += tmp;
			a[m++] = tmp;
			tmp = 0;
		}
	}

	printf("%d\n%d", ans, m);
	for(int i = 0; i < m; ++i)
	{
		printf(" %d", a[i]);
	}
	printf("\n");
}

