#include <iostream>
#include <string>
#include <stack>
#include <deque>
#include <algorithm>
using namespace std;

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

  stack<int> state;
  deque<pair<int, int>> lakes;

  int lsum = 0;
  for (int i = 0; i < (int)s.size(); i++)
  {
    char ch = s[i];
    if (ch == '\\')
    {
      state.push(i);
    }
    else if (ch == '/' && state.size() > 0)
    {
      int ls = i - state.top();
      lsum += ls;

      while (lakes.size() > 0 && state.top() < lakes.back().first)
      {
        ls += lakes.back().second;
        lakes.pop_back();
      }
      lakes.push_back(make_pair(state.top(), ls));
      state.pop();
    }
  }

  cout << lsum << "\n"
       << lakes.size();
  for (auto itr = lakes.begin(); itr != lakes.end(); ++itr)
  {
    cout << " " << (*itr).second;
  }
  cout << endl;
}

