#include<stdio.h>
#include<time.h>
int main(void)
{
	clock_t start, end;
	int i;
	int j=0;
	int d=0;
	int e=0;
	int f=0;
	char k[100]; /*??\?????????*/
	int s[50]={0}; /*?????¢???*/
	int stotal=0; /*????¨???¢???*/
	scanf("%s",k);
	start=clock();
	for(i=0;i<100;i++){
		if(k[i]=='\\'){/*????????¢???????????°d???????¶????*/
			d++;
		}
		else if(k[i]=='_'){/*???????????¨?????????????????¨???d???0?????¨???????????????d???1??\?????????e???????¶????*/
				if(d==0){
					break;}
				else{
					e++;}
		}
		else if(k[i]=='/'){/*????????¢??????????????¨???*/
			if(k[i+1]!='/'){/*???????¬?????????¢???????????¢??§???????????°????????¢??¨????????¢????????????????????¢????¨????*/
				if(d>f+1){
					s[j]=(f+1)*(f+1)+e*(f+1);
				d=0;
				e=0;
				f=0;
				j++;}
				else{
					s[j]=d*d+e*d;
				d=0;
				e=0;
				f=0;
				j++;}
			}
			else{/*?¬?????????¢???????????¢??????f???????¶????*/
				f++;}
		}
		else{}
	}

	for(i=0;i<j;i++){/*?????¢?????????????¨????*/
		stotal+=s[i];
	}
	printf("%d\n%d",stotal,j);
	for(i=0;i<j;i++){
		printf(" %d",s[i]);
	}
	end=clock();
	printf("\n%f?§?\n", (float)(end-start)/CLOCKS_PER_SEC);
	return 0;
}