#include <stdio.h>

int main(int argc, char *argv[])
{
  int down[20000];
  int lake[20000][2];
  char c;
  int i = 0;
  int A, k;
  int in[2];
  int left, s;

  in[0] = 0;
  in[1] = 0;

  while ((c = getchar()) != EOF) {
    switch (c) {
    case '\\':
      down[in[0]++] = i;
      break;
      
    case '_':
      break;
      
    case '/':
      if (in[0] == 0) break;
      else {
	left = down[--in[0]];
	s = i - left;
	if (in[1] == 0) {
	  lake[in[1]][0] = left;
	  lake[in[1]][1] = s;
	  in[1]++;
	} else {
	  while (lake[in[1] - 1][0] > left) {
	    s += lake[--in[1]][1];
	  }
	  lake[in[1]][0] = left;
	  lake[in[1]][1] = s;
	  in[1]++;
	}
      }
      break;

    default:
      break;
    }
    i++;
  }

  A = 0;
  k = in[1];
  for (i = 0; i < k; i++) A += lake[i][1];

  printf("%d\n", A);
  printf("%d ", k);
  for (i = 0; i < k; i++) {
    if (i != k - 1) printf("%d ", lake[i][1]);
    else printf("%d\n", lake[i][1]);
  }

  return 0;
}