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

int main()
{
	string S;
	cin >> S;

	stack<int> s1;
	stack<pair<int, int>> s2;
	int sum = 0;
	for( int i = 0; i < S.size(); i++ ) {
		if( S[i] == '\\' ) {
			s1.push( i );
		}
		else if( S[i] == '/' && s1.size() ) {
			int j = s1.top();
			s1.pop();
			sum += i - j;
			int a = i - j;
			while( s2.size() > 0 && s2.top().first > j ) {
				a += s2.top().second;
				s2.pop();
			}
			s2.push( make_pair( j, a ) );
		}
	}
	vector<int> ans;
	while( s2.size() ) {
		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;
}

