#include<stdio.h>
#include<stdlib.h>

int m[20000];
int n[20000];
int r[20000];
int a,b,c;

void push_1(int x) {
  m[a]=x;
  a++;
}
void push_2(int x) {
  n[b]=x;
  b++;
}
void push_3(int x) {
  r[c]=x;
  c++;
}
int pop_1() {
  if(a==0) return -1;
  a--;
  return m[a];
}
int pop_2() {
  if(b==0) return 0;
  b--;
  return n[b];
}
int pop_3() {
  if(c==0) return -1;
  c--;
  return r[c];
}

int main() {
  char w[20000];
  scanf("%s",w);
  int i=0,j=0,d=0,sum=0,z=0,g[20000];
   a=b=c=0;
   
  while(w[i]=='\\' || w[i]=='/' || w[i]=='_') {
    if(w[i]=='\\') push_1(i);
    if(w[i]=='/') {
      int x=pop_1();
      if(x>=0) {
          d=0;
	    while(1) {
	    int y=pop_3();
	    if(y<x) {
	    if(y!=-1) push_3(y);
	    break;
	  }
	  
	 d+=pop_2();
	 
	}
	d+=i-x;
	push_2(d);
	push_3(x);
  }
  }
    i++;
}

  while(1){
    int x=pop_2();
    if(x==0) break;
    sum+=x;
    g[z]=x;
    z++;
  }
  
  
  printf("%d\n%d",sum,z);
  for(j=z-1; j>=0; j--) printf(" %d",g[j]);
  printf("\n");
  return 0;
}

