#include <iostream>
#include <stack>
#include <vector>

using namespace std;

int flood[20010];

int main() {
    int allFlood = 0, sum = 0;
    string s;
    stack<int> st;
    vector<int> v;
    cin >> s;
    for (int i = 0; i < s.size(); ++i) {
        if (s[i] == '\\') st.push(i);
        else if (s[i] == '/' && !st.empty()) {
            for (int j = st.top(); j < i; ++j) {
                flood[j]++;
                allFlood++;
            }
            st.pop();
        }
    }
    cout << allFlood << endl;
    for (int i = 0; i < s.size(); ++i) {
        if (flood[i]) sum += flood[i];
        else if (sum) {
            v.push_back(sum);
            sum = 0;
        }
    }
    cout << v.size();
    for (int i = 0; i < v.size(); ++i) cout << ' ' << v[i];
    cout << endl;
    return 0;
}
