#include <bits/stdc++.h>
using namespace std;

int main(void)
{
	char ch;
	stack<int> S1;
	stack<pair<int, int> > S2;
	pair<int, int> p;
	int i, j, sum = 0, area;
	for (i = 0; cin >> ch; i++)
	{
		if (ch == '\\')
			S1.push(i);
		else if (ch == '/')
		{
			if (!S1.empty())
			{
				j = S1.top();
				S1.pop();
				area = i - j;
				sum += area;
				while (!S2.empty())
				{
					if (S2.top().first > j)
					{
						area += S2.top().second;
						S2.pop();
					}
					else 
						break;
				}
				S2.push(make_pair(j, area));
			}
		}
	}
	
	deque<int> D;
	while (S2.size() > 0)
	{
		D.push_front(S2.top().second);
		S2.pop();
	}
	cout << sum << endl << D.size();
	for (i = 0; i < D.size(); i++)
		cout << " " << D[i];
	cout << endl;
}
