#include<stdio.h>
#include<stack>
#include<vector>
using namespace std;

int main() {
  char c;
  stack<int> a;
  stack<pair<int, int> > b;
  for ( int i = 0; scanf("%c", &c) != EOF; i++ ) {
    if ( c == '\\' ) a.push(i);
    else if ( c == '/' && !a.empty()) {
      int correspond = a.top();
      a.pop();
      int tv = i - correspond;
      while(!b.empty() && b.top().first > correspond) {
        tv += b.top().second;
        b.pop();
      }
      b.push(make_pair(correspond, tv));
    }
  }

  int tv = 0;
  vector<int> vv;
  while(!b.empty()) {
    int v = b.top().second;
    vv.push_back(v);
    tv += v;
    b.pop();
  }

  printf("%d\n%lu", tv, vv.size());
  for (vector<int>::reverse_iterator ri = vv.rbegin(); ri != vv.rend(); ri++ ) {
    printf(" %d", *ri);
  }
  printf("\n");
  return 0;
}
