#include<iostream>
#include<stack>
#include<vector>
#include<string>
#include<algorithm>
#include<stdlib.h>
using namespace std;

int main()
{
	stack<int> S1;
	stack< pair<int, int> > S2;
	char c_s;
	int sum;
	int a, i, j;
	for(i; cin >> c_s; i++)
	{
		if(c_s == '\\') S1.push(i);
		else if(c_s == '/' && S1.size() > 0)
		{
			j = S1.top(); S1.pop();
			sum += i - j;
			a = i - j;
			while( S2.size() > 0 && S2.top().first > j ) // This is important.
			{
				a += S2.top().second; S2.pop();
			}
			S2.push(make_pair(j, a));
		}
	}
	
	vector<int> ans;
	while(S2.size() > 0) { ans.push_back(S2.top().second); S2.pop();}
	reverse(ans.begin(), ans.end());
	cout << sum << endl;
	cout << ans.size();
	for (int i=0; i < ans.size(); i++)
	{
		cout << " ";
		cout << ans[i];
	}
	cout << endl;
//	system("pause");
	return 0;
}

