#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define mymalloc(p,n) {p = malloc((n)*sizeof(*p));if ((p)==NULL) {printf("not enough memory?\n"); exit(1);};}

typedef struct obj{
	struct obj *prev;
	struct obj *next;
	int key;
}obj;

typedef struct{
	struct obj *root;
	struct obj *last;
	int size;
	int csum;
}dlist;

obj *createObj(int n){
	obj *ob;
	mymalloc(ob,1);
	ob->prev=NULL;
	ob->next=NULL;
	ob->key=n;
	return ob;
}

dlist *createDlist(){
	dlist *list;
	mymalloc(list,1);
	list->root=NULL;
	list->last=NULL;
	list->size=0;
	list->csum=0;
}

void insert(dlist *list,int key){
	obj *input;
	input=createObj(key);
	if(list->root==NULL){
		list->root=input;
		list->last=input;
	}
	else{
		list->root->prev=input;
		input->next=list->root;
		list->root=input;
	}
	list->size++;
	list->csum+=key;
}


void append(dlist *list1,dlist *list2){
	if(list2->size==0){
		return;
	}
	if(list1->last==NULL){
		list1->root=list2->root;
		list1->last=list2->last;
	}
	else{
		list1->last->next=list2->root;
		list2->root->prev=list1->last;
		list1->last=list2->last;
	}
	list1->size+=list2->size;
	list1->csum+=list2->csum;
	list2->root=NULL;
	list2->last=NULL;
}

obj *deleteF(dlist *list){
	obj *output;
	if(list->root==NULL){
		return NULL;
	}
	else{
		output=list->root;
		if(list->root->next==NULL){
			list->root=NULL;
			list->last=NULL;
		}
		else{
			list->root=list->root->next;
			list->root->prev=NULL;
		}
		return output;
	}
}

void reverse(dlist *list,dlist *slist){
	int cumH,sum,c1;
	obj *ob;
	dlist *blist;
	blist=createDlist();
	cumH=0;
	sum=0;
	ob=deleteF(list);
	while(1){
		if(ob==NULL){break;}
		c1=ob->key;
		if(c1==1){
			sum+=2*cumH+1;
			cumH++;
		}else{
		if(c1==0){
			sum+=2*cumH;
		}else{
		if(c1==-1){
			if(cumH!=0){
				sum+=2*cumH-1;
				cumH--;
				if(cumH==0){
					insert(blist,sum/2);
					sum==0;
				}
			}
		}}}
		ob=deleteF(list);
	}
	append(slist,blist);
}
	
		
		
main(){
	int cumH,tmpH,n;
	char c1;
	dlist *slist,*list;
	obj *ob;
	cumH=0;
	list=createDlist();
	slist=createDlist();
	while(scanf("%c",&c1)!=EOF){
		if(c1=='\\'){
			cumH--;
			insert(list,-1);
		}else{
		if(c1=='_'){
				insert(list,0);
		}else{
		if(c1=='/'){
			cumH++;
			if(cumH>0){
				cumH=0;
			}else{
			insert(list,1);
			if(cumH==0){
				reverse(list,slist);
			}}
		}}}
	}
	
	
	reverse(list,slist);
	printf("%d\n",slist->csum);
	printf("%d ",slist->size);
	ob=deleteF(slist);
	while(1){
		printf("%d",ob->key);
		ob=deleteF(slist);
		if(ob!=NULL){
			printf(" ");
		}else{
			printf("\n");break;
		}
	}
	return 0;
}