#include <stdio.h>
#include <string.h>

int main()
{
  int i, j, narea, ssum;
  char s[20001];
  fgets(s, 20001, stdin);
  if (s[strlen(s)-1]=='\n') s[strlen(s)-1]='\0';
  int d, dmin, dmax, total, slen = strlen(s);
  d = dmin = dmax = 0;
  for (i=0;i<slen;i++) {
    if (s[i]=='\\') d--;
    else if (s[i]=='/')  d++;
    if (dmin>d) dmin=d;
    else if (dmax<d) dmax=d;
  }
  int start[dmax-dmin+1];
  for (i=0; i<dmax-dmin+1; i++)  start[i] = -1;
  int h[slen];
  bzero(h, sizeof(int)*slen);
  total = 0;
  d = -dmin;
  for (i=0; i<slen; i++) {
    if (s[i]=='\\') start[d--]=i;
    else if (s[i]=='/') {
      d++;
      if (start[d]>=0) {
        for (j=start[d]; j<i; j++)  h[j]++;
        total += i-start[d];
      }
    }
  }

  printf("%d\n", total);
  narea=ssum=0;
  for (i=0; i<slen; i++) {
    ssum += h[i];
    if (h[i]==0) {
      if (ssum>0) narea++;
      ssum=0;
    }
  }
  printf("%d", narea);
  if (narea>0) {
    for (i=0; i<slen; i++) {
      ssum += h[i];
      if (h[i]==0) {
        if (ssum>0) printf(" %d", ssum);
        ssum=0;
      }
    }
  }
  printf("\n");
  return 0;
}
