/*
 * ?´??°´.c
 *
 *  Created on: 2016/03/15
 *      Author: Owner
 */


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

char grd[20000];
int len,top,top_pos;
int *depth; //??°??¢?????????(??±???)
int *surf; //?°´??¢?????????(??±???)
float *area; //????????¢???

//??°??¢?????±????????¬???
void depth_cnt(){
	int point,i;
	char c;
	point = 0; //????????±???
	top = 1e9; //?????????
	top_pos = 0; //??????????????????
	for(i=0;i<len;i++){
		depth[i] = 0;
	}
    //??????????????£????????????????????????
	for(i=0;i<len;i++){
		c = grd[i];
		if(c == '?\?\'){
			point++;
			depth[i] = point;
		}
		if(c == '/'){
			point--;
			depth[i] = point;
		}
		if(c == '_'){
			depth[i] = point;
		}
		//??????????????´??°???????????°
		if(top > point){
			top = point;
			top_pos = i+1;
		}
	}
	return;
}

//???????????????????????´????°´??¢
void surf_leftcnt(){
	int i,sur_top;
	char c;
	sur_top = 0;

	//??¨????????????????????§??????????????§????????????????°´??¢?????????
	for(i=0;i<top_pos;i++){
		surf[i] = 0;
		c = grd[i];

		if(sur_top>depth[i]){
			sur_top = depth[i];
			surf[i] = depth[i];
		}else{
			surf[i] = sur_top;
		}
	}

	return;
}

//???????????????????????´????°´??¢
void surf_rightcnt(){
	int i,sur_top;
	sur_top = depth[len];

	//??¨????????????????????§??????????????§????????????????°´??¢?????????
	for(i=len;i>=top_pos;i--){
		surf[i] = 0;

		if(sur_top>depth[i]){
			sur_top = depth[i];
			surf[i] = depth[i];
		}else{
			surf[i] = sur_top;
		}
	}

	return;
}

//????????¢???????¨????
void Area_cnt(){
	int i,t,kosuu,all_area;
	t=0;
	kosuu=0;
	all_area=0;
	for(i=0;i<100;i++){
		area[i] = 0;
	}
	//?????????????????????????¨????(??\????????¢???????¨????????????????????????????????????¨????????????)
	if(depth[0]==1){
		area[t] += 0.5;
	}

	for(i=1;i<len;i++){

		//?°´??????????????°
		if(depth[i]>surf[i]||depth[i-1]>surf[i]){
			//????????°????????¢???????¨????
			area[t] += (((float)depth[i]-(float)surf[i])+
					   ((float)depth[i-1]-(float)surf[i]))/2;
		}
		if(depth[i]==surf[i]){
			t++;
		}
	}

	//????????°??¨????¨????????¨?????????¨???
	for(i=0;i<=t;i++){
		if((int)area[i] > 0){
			kosuu++;
			all_area += (int)area[i];
		}
	}
	printf("%d?\n",all_area);
	printf("%d ",kosuu);

	//??¨??????????????¨???
	for(i=0;i<=t;i++){
		if((int)area[i] > 0){
			printf("%d ",(int)area[i]);
		}
	}
	return;
}

int main(){
	scanf("%s",grd);
	len = strlen(grd);
	depth = (int*)malloc(sizeof(int)*(len));
	surf = (int*)malloc(sizeof(int)*(len));
	area = (float*)malloc(sizeof(float)*(len));

	depth_cnt();//??°??¢?????±????????¬???
	surf_leftcnt();//???????????????????????´????°´??¢
	surf_rightcnt();//???????????????????????´????°´??¢
	Area_cnt();//????????¢???????¨????

	return 0;
}