
#include<stdio.h>
#include<stdlib.h>
typedef struct {
  int area;
  int key;
} Area;
  
int main(){
  int stack[20000];
  Area stack2[10000];
  int flag3=0,flag2=0,j,top=0,top2=0,sum=0,i=0,area,k=0,flag=0;
  char c;
  while(scanf("%c",&c)!=EOF){
    flag2=0;
    if(c=='\\'){
      flag3=1;
      stack[top]=i;
      top++;
    }
    else if(c=='_'){
  }
    else if(c=='/'){
      if(flag3==0){i++; continue;}
      if(top-1<0) {i++; continue;}
      area=i-stack[top-1];
      stack2[top2].key=stack[top-1];
      top--;
      if(flag==0){flag=1; i++; stack2[top2].area=area; top2++; continue;}
      if(top2-1<0){ i++; continue;}
      
      else{
	      for(k=0;k<=top2-1;k++){
		if(stack2[top2].key<=stack2[k].key){
		  if(flag2==0){j=k; flag2=1; stack2[j].key=stack2[top2].key;}
		  else stack2[j].area+=stack2[k].area;
		  
		}
	      }
	      if(flag2==0)
		{
	          stack2[top2].area=area;
	  
	          top2++;
		}
	      else
		{
		 stack2[j].area+=area;
     
		 top2=j+1;
		}
      }       
	      
  
	 
    
	            
    }   
  
    i++;
  }
  for(i=0;i<top2;i++) sum+=stack2[i].area;
  printf("%d\n%d",sum,top2);
  if(top2==0) printf("\n");
    if(top2!=0){
      printf(" ");
      for(i=0;i<top2;i++){
      if(i==top2-1)printf("%d\n",stack2[i].area);
      else printf("%d ",stack2[i].area);
  }
    }
  return 0;
} 

