using System;
using System.Collections.Generic;


class Program
{
    static void Main(string[] args)
    {
        Input CInput = new Input();

        List<Downdata> DownDB = new List<Downdata>();
        List<int> WaterSizeDB = new List<int>();

        var input = CInput.Line1_string();

        int cnt = 0, Data_W = 0, Data_H = 0;

        while (true)
        {
            if (cnt == input.Length) break;

            if (input[cnt].ToString() == "\\")
            {
                DownDB.Add(new Downdata(Data_W, Data_H));
                Data_H--;
            }
            else if (input[cnt].ToString() == "/")
            {
                for (int i = 0; i < DownDB.Count; i++)
                {
                    DownDB[i].WaterJudge(Data_W + 1, Data_H + 1); // +1????????????????????§?¨???¨??????
                }
                Data_H++;
            }
            Data_W++; cnt++;
        }

        int sum = 0, j, sample = 0;
        bool is_end = false;
        int CheckCompleteCount = 0;

        if (DownDB.Count == 0) is_end = true;

        while (!is_end)
        {
            while (DownDB[CheckCompleteCount].InvalidCheck())
            {
                if (CheckCompleteCount + 1 == DownDB.Count) { is_end = true; break; }
                CheckCompleteCount++;
            }
            if (CheckCompleteCount + 1 == DownDB.Count)
            {
                if (!DownDB[CheckCompleteCount].InvalidCheck()) { WaterSizeDB.Add(DownDB[CheckCompleteCount].WaterSize()); break;}
                else break;
            }
            sum = DownDB[CheckCompleteCount].WaterSize();
            sample = CheckCompleteCount;
            j = CheckCompleteCount + 1;

            while (true)
            {
                if (j == DownDB.Count)
                {
                    WaterSizeDB.Add(sum);
                    is_end = true;
                    break;
                }
                if (DownDB[j].InvalidCheck())
                {
                    WaterSizeDB.Add(sum);
                    CheckCompleteCount++;
                    break;
                }

                if (DownDB[j].InsideW(DownDB[sample].GetW(), DownDB[sample].GetRightW()) == true)
                {
                    sum += DownDB[j].WaterSize();
                    CheckCompleteCount++;
                }
                else
                {
                    WaterSizeDB.Add(sum);
                    CheckCompleteCount++;
                    break;
                }
                j++;
            }
        }


        int total = 0;
        foreach (var value in WaterSizeDB)
        {
            total += value;
        }
        System.Console.WriteLine(total);
        System.Console.Write("{0}", WaterSizeDB.Count);
        for (int i = 0; i < WaterSizeDB.Count; i++)
        {
            System.Console.Write(" {0}", WaterSizeDB[i]);
        }
        System.Console.WriteLine();

    }
}

class Downdata
{
    private int m_W;  // ?¨??????§?¨?
    private int m_H;  // ??±???
    private int m_RightW;    // ?????????????????§?¨?

    public Downdata(int W, int H)
    {
        m_W = W;
        m_H = H;
        m_RightW = -1;
    }

    public int GetW()
    {
        return m_W;
    }
    public int GetRightW()
    {
        return m_RightW;
    }

    public bool WaterJudge(int W, int H)
    {
        if (m_RightW != -1) return true;
        if (m_H != H) return false;
        m_RightW = W;
        return true;
    }

    public int WaterSize()
    {
        return m_RightW - m_W - 1;
    }

    public bool InsideW(int W, int RightW)
    {
        if (W < m_W && RightW > m_RightW) return true;
        return false;
    }

    // ??????????????????water?????????????????????????????? true??§??????
    public bool InvalidCheck()
    {
        if (m_RightW == -1) return true;
        else return false;
    }
}







class Input
{
    public enum Define
    {
        MAX_ArraySize = 100,
        ArraySize2d = 100,                // 2?¬?????????????[][?] ???????
    }

    public string Line1_string()
    {
        return Console.ReadLine();
    }

    public string[] Line1_string(int chr)
    {
        var input = Console.ReadLine();
        var split = input.Split(' ');
        return split;
    }

    public int Line1_int()
    {
        var input = Console.ReadLine();
        return int.Parse(input);
    }

    public double Line1_double()
    {
        var input = Console.ReadLine();
        return double.Parse(input);
    }

    public int[] Line1_int(int chr, int num)
    {
        var input = Console.ReadLine();
        var split = input.Split(' ');
        int[] spliti = new int[100];
        for (int i = 0; i < num; i++)
        {
            spliti[i] = int.Parse(split[i]);
        }
        return spliti;
    }

    public int[] Multiline_int(ref int datanum)
    {
        int i = 0;
        int[] data = new int[(int)Input.Define.MAX_ArraySize];
        while (true)
        {
            var input = Console.ReadLine();
            var value = int.Parse(input);
            if (value == 0) break;
            data[i] = value;
            i++;
        }
        datanum = i;
        return data;
    }

    /// <summary>
    /// ?????°??????int??????????????????????????????
    /// </summary>
    /// <param name="chr">???????????????</param>
    /// <param name="num">?????????????????????????????°</param>
    /// <param name="datanum">??????????????????????????°</param>
    /// <returns></returns>
    public int[,] Multiline_int(int chr, int num, ref int datanum)
    {
        int i = 0, zerocount = 0;
        int[,] data = new int[(int)Input.Define.MAX_ArraySize, (int)Input.Define.ArraySize2d];
        while (true)
        {
            var input = Console.ReadLine();
            var split = input.Split(' ');
            int[] spliti = new int[100];
            zerocount = 0;
            for (int j = 0; j < num; j++)
            {
                spliti[j] = int.Parse(split[j]);
                if (spliti[j] == 0) zerocount++;
            }
            if (zerocount == num) break;
            for (int j = 0; j < num; j++)
            {
                if (spliti[0] == 0 && spliti[1] == 0) break; // ???????????????????????????
            }
            for (int j = 0; j < num; j++)
            {
                data[i, j] = spliti[j];
            }
            i++;
        }
        datanum = i;
        return data;
    }

    /// <summary>
    /// ?????°??????int??????????????????????????????
    /// </summary>
    /// <param name="chr">???????????????</param>
    /// <param name="num">?????????????????????????????°</param>
    /// <param name="loadnum">???????????????????????°</param>
    /// <returns></returns>
    public int[,] Multiline_int(int chr, int num, int loadnum)
    {
        int i = 0;
        int[,] data = new int[(int)Input.Define.MAX_ArraySize, (int)Input.Define.ArraySize2d];
        while (true)
        {
            if (loadnum == i) break;

            var input = Console.ReadLine();
            var split = input.Split(' ');
            int[] spliti = new int[100];
            for (int j = 0; j < num; j++)
            {
                spliti[j] = int.Parse(split[j]);
            }
            for (int j = 0; j < num; j++)
            {
                data[i, j] = spliti[j];
            }
            i++;
        }
        return data;
    }


}

//??£?¨????????????¬

//int[] input = new int[(int)Input.Define.MAX_ArraySize];
//int[,] input = new int[(int)Input.Define.MAX_ArraySize, (int)Input.Define.ArraySize2d];

class EasyTask
{
    public void Swap(ref int a, ref int b)
    {
        int buf = 0;
        buf = a;
        a = b;
        b = buf;
    }






}

Measured memory_bytes: 10476