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


#define num1 20000

int main(void)
{
	char men[num1];
  int k=0;
  int i;
  int s1[num1];
  int s2[num1];
  int R[num1];
	scanf("%s", men);
	int count1=0;
  int count2=0;
	int x=0;
  int y=0;
  i=0;

	while(i<strlen(men)){
		  if(men[i]=='\\'){
			     s1[count1++]=i;
		                  }
		                    else if(count1>0 && men[i]=='/' ){
                      			x=s1[--count1];
                      			y=i-x;
                      			while(count2>0 && s2[count2-1]>x){
				                          y=y+R[--count2];
			                             }
			R[count2]=y;
			s2[count2]=i;
			count2++;
		}
    i++;
	}

	for(i=0; i<count2; i++){
		k=k+R[i];
	}

	printf("%d\n", k);
	printf("%d", count2);
	for(i=0; i<count2; i++){
		printf(" %d", R[i]);
	}
	printf("\n");

	return 0;
}

