#include <iostream>
#include <algorithm>
#include <stack>
#include <vector>
#include <string>
#define p pair<int, int>
using namespace std;

int main(){

  stack<int> s1;
  stack<p> s2;
  string m;
  int sum = 0, a;

  cin >> m;

  for(int i = 0; i < m.size(); i++){
    if(m[i] == '\\'){
      s1.push(i);
    }else if(m[i] == '/' && s1.size() > 0){
      int j = s1.top(); s1.pop();
      sum += i - j;
      a = i - j;
      while(s2.size() > 0 && s2.top().first > j){
        a += s2.top().second; s2.pop();
      }
      s2.push(p(j, a));
    }
  }
  vector<int> ans;
  while(!s2.empty()){
    ans.push_back(s2.top().second);
    s2.pop();
  }
  cout << sum << endl;
  cout << ans.size();
  for(int i = ans.size()-1; i >= 0; i--){
    cout << " " << ans[i];
  }
  cout << endl;
  return 0;
}
