#include <stdio.h>

#define SIZE 10000

int up, low, width, trapzoid, midFlat;

void initilize(void){
  up = low = width = trapzoid = midFlat = 0;
}

void initMidFlat(void){
  up = trapzoid = midFlat = 0;
  low = width = 1;
}

int main(void){
  char c;
  int allArea = 0, area[SIZE] = {0}, i = 0, j;
  initilize();
  while ((c = fgetc(stdin)) != '\n') {
    switch (c) {
    case '\\':
      low++;
      width++;
      break;
    case '/':
      if (low) {
	up++;
	width++;
      }
      break;
    case '_':
      if (low && !up) {
	trapzoid++;
	width++;
      }
      else if (low && up) {
	up++;
	width++;
	midFlat++;
      }
      break;
    default:
      puts("Non definition symbol!");
      break;
    }
    // calculate area
    if (low == up && 0 < low ) {
      if (trapzoid)
	area[i] += (width + trapzoid) * low / 2;
      else
	// triangle
	area[i] += width * low / 2;
      if (midFlat)
	initMidFlat();
      else {
       i++;
       initilize();
      }
    }
  }

  // output
  for (j = 0; j < i; j++)
    allArea += area[j];
  printf("%d\n", allArea);

  printf("%d ", i);
  for (j = 0; j < i; j++) {
    if(j)
      printf(" ");
    printf("%d", area[j]);
  }
  puts("");
  return 0;
}