//??????20170320

//???????????£?§£????§£?±????.Tostring()???????????£???????????????
//????????????????????????20170314
//list<>???????????????????????§????????????????????????????????????????????£?????????????????????????????????????????????????°???????????????¬????????????????????¢?????´???????????????????????????
//list<>???foreach?????????????????????????????????????????????
using System;
using System .Collections .Generic;
using System.IO;


class Program
{
    public static void Main( string[] args )
     {
        //????????????
        var symbols =@Console.ReadLine();
        // var symbols =@Console.ReadLine();
        //  string[] mountain = symbols .Split();
      //  char[] mountain = symbols .ToCharArray();
        //search??????????????????
        new Search( symbols );
        //?±???????????????\?????????
    }
}
class Search
{

    //	int searchIndex = 0;
    //search index????????????
    //int pondCounter = 0;
    //?±??????°????????????
    //	int deapth = 0;
    //?±???±???
    int totalArea = 0;
    //?±?????????¢???
    //?±???????????????¢??????????´????????????????????????????List??§?????????????????°????????????????????????????????????
    //??????????????°???????????????????????\?????????
    List<int> ponds = new List<int>();
    //?????????????????????
    public Search( string t )
    {
        pondSearch( t );
    }
    public void pondSearch( string terrain )
    {
        int startPoint = 0;//?§???????index
        int end = 0;//?????????intdex	  

               	 startPoint = pondStartPointSearch( terrain , startPoint );
        while ( startPoint < terrain .Length-1 )
        {//?§??????¢????????????????´????????????????????????????
        	//????????°??????????????¨?????´???????????°?°???\???????????????
        	//??????????????´??§??????????????????????????????????????????
        	
         
            end = pondEndPointSearch( terrain , startPoint   );
        	
         
			
            
            //end??¢?´¢?????????????????????????????£?????´?????¨???????????£?????´??????
            while ( end >= terrain .Length)
            {//?????????????????§startPoint+1;//?????¨????±?????????????????????????
                startPoint += 1;
                
                startPoint = pondStartPointSearch( terrain , startPoint );
                if ( startPoint>= terrain .Length -1 )
                {
              
                	break;
                }
                
               
                end = pondEndPointSearch( terrain , startPoint );
            }
            if ( startPoint >= terrain .Length -1 )
                {
              
                	break;
                }
            
            //?±???????????????£??????
            //List<> ponds????±????????????¢??????add
            int tempArea= ( int )pondArea( terrain , startPoint , end );
            ponds .Add(tempArea );
            totalArea+=tempArea;
            startPoint = end + 1;//?§??????¢?????¨index????±??????????????????????????¨????
             
                    	 startPoint = pondStartPointSearch( terrain , startPoint );
          
        }
        //????????????????????????????????????
        answer();
    }


    /*public int pondDeapth()
    {


    }//?±???±????¨????????????????
    int deapestPoint=0;//?±???????????????°???index???
    */
    public double pondArea( string terrain , int start , int end )//?±???¢???????????????
    {
        int nowDeapth = 0;//?§??????????????????¨??±???
        int area = 0;

        //?§????????????°??¢????????±???????¢????????????????
        //??°??¢?????¨?????±?????¨??????????????¢???????±??????????
        //"\"????????¢??????????§?????????¨????§?????±????????¢????¨??????????????????±?????????
        //_????????¢??????????§??????±????????±????????????????????¨?????£????????????
        // ???/"??§?????±??????????????¢????¨????????????????
        //????§?????????§???????§?????????????????????§????????????????????????
        for ( int i = start ; i <= end ; i++ )
        {
            switch ( terrain[i] )
            {
                case '\\':
                    //??????????¨????
                    area += 1 + 2 * nowDeapth;
                    nowDeapth++;
                    break;
                case '/':
                    nowDeapth--;
                    //??????????¨????
                    area += 1 + 2 * nowDeapth;
                    break;
                case '_':
                    //????????§?¨????
                    area += 2 * nowDeapth;
                    break;
            }
        }

        //?±??????¢??????????????????
        return area / 2;
    }

    //?±??§??????¢?´¢????????????
    public int pondStartPointSearch( string terrain , int sp )
    {
        while ( sp < terrain .Length - 1 )//??????????´?????????????????????¨???????????????
        {
            if ( terrain[sp] == '\\' )
            {
                return sp;//return ?±?????§???????index?????????
            }

            sp++;
        }
        //???????????§????????????????????£?????´?????????????????????
        return sp;

    }
    public int pondEndPointSearch( string terrain , int searcher )
    {
         searcher +=  1;
        //?±??????????????????????"/"??§????????????????????????????????\????????????index????????????
        //??????if(deapth==0&&s==/)
        //???????????§????????????????±?????????????????????£????????????????????????
        int d = 1;//?????¨??±?????°??¢???????????????????????±?????¨?????????
        while ( searcher < terrain .Length )
        {
            if ( d == 1 && terrain[searcher]== '/' )
            {//??±???????????¨?????????/????????\???????±??????????

                return searcher;

            }
            else
            {
                switch ( terrain[searcher] )
                {
                    case '\\':

                        d++;
                        break;
                    case '/':
                        d--;

                        break;
                    case '_':

                        break;
                }
                searcher++;
            }
        }
        //???????????§????????????????????£????????§searcher>t.length??????
        return searcher;

    }
    public void answer()//????????????
    {
        //int area = 0;//?????¢???
        int pondsC=ponds.Count;
      //  int[] array=new int[ponds.Count];
        	
      //  array =ponds.ToArray();
        var sw = new StreamWriter(Console.OpenStandardOutput())
		{AutoFlush = false};
        Console.SetOut(sw);
     /*   
        for(int s=0;s<array.Length;s++)
        {
        	area+=array[s];
        }
        Console.WriteLine(area);
        if(array.Length==1)
        { 
        	Console .WriteLine( " " + array[0] );
        
        }
         else if (array.Length== 0 )
        {
            Console .WriteLine( );
        }
        else
        {
            for ( int f = 0 ; f <array.Length - 1 ; f++ )
            {
                Console .Write( " " + array[f] );
            }
            Console .WriteLine( " " + array[array.Length - 1] );
        }
        */
  		/*
        foreach ( int a in ponds )
        {
            area += a;
        }
      */
		
        Console .WriteLine( totalArea );//?????¢???????????????????????????
                                   //?±??????°
        Console .Write( pondsC );
        //List<>??????????????????????´?????????????????????????
        if ( pondsC == 1 )
        {
            Console .WriteLine( " " + ponds[0] );
        }
        else if ( pondsC == 0 )
        {
            Console .WriteLine( );
        }
        else
        {
            for ( int f = 0 ; f < pondsC - 1 ; f++ )
            {
                Console .Write( " " + ponds[f] );
            }
            Console .WriteLine( " " + ponds[pondsC - 1] );
        }
        
        	Console.Out.Flush();
    }	
}

Measured memory_bytes: 9368