#include<stdio.h>

int main()
{
  char s[20000];
  int high[20000];
  int a[20000];
  int tmp[20000];
  int temp = 0;
  int count = -1;
  scanf("%s", s);
  int i, j, k, tmphigh = 0;
  int A = 0;
  for(i = 0; s[i] != '\0'; i++) {
    switch(s[i]) {
    case '\\':
      tmphigh--;
      high[i] = tmphigh;
      break;
    case '_':
      high[i] = 20000;
      break;
    case '/':
      high[i] = tmphigh;
      for(j = i-1; j >= 0; j--) {
	if(high[j] == tmphigh) {
	  //	  printf("%d\n", i - j);
	  A += i - j;
	  if (j < tmp[count]) {
	    for (k = count-1; k >=  0; k--) {
	      if (j < tmp[k]) {
		a[k] += a[count];
		a[count] = 0;
		count = k;
	      }
	    }
	    a[count] += i - j;
	    tmp[count] = j;
	    //	    printf("count = %d, a = %d\n", count, a[count]);
	  } else {
	    count++;
	    a[count] += i - j;
	    tmp[count] = j;
	    //	    printf("count = %d, a = %d\n", count, a[count]);
	  }
	  break;
	}
      }
      tmphigh++;
      break;
    }
  }
  printf("%d\n", A);
  printf("%d", count+1);
  for(i=0;i<=count;i++){
    printf(" %d", a[i]);
  }
  printf("\n");
  return 0;
}