using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            var line = Console.ReadLine();
            var lakes = new List<double>();
            var moutains = Mountain.Parse(line);
            var all = 0.0;

            for (int i = 0; i < moutains.Count; i++)
            {
                var height = moutains[i].Height;
                var isFirst = false;


                for (int k = i; k < moutains.Count; k++)
                {
                    var m = moutains[k];
                    var result = m.Height <= height && !isFirst;
                    isFirst |= (m.Height == height && k != i);
                    if (!result)
                    {
                        break;
                    }

                    if (2 <= (k - i) && m.Height == height && moutains[i].Water == null)
                    {
                        var sum = 0.0;
                        for (int j = i; j < k; j++)
                        {
                            moutains[j].Water = height;
                            sum += moutains[j].Area();
                        }

                        if (sum != 0.0)
                        {
                            lakes.Add(sum);
                            all += sum;
                        }
                    }
                }
            }

            System.Console.WriteLine(all);

            if (lakes.Count != 0)
            {
                System.Console.WriteLine(lakes.Count + " " + string.Join(" ", lakes.Select(x => x.ToString()).ToArray()));
            }
            else
            {
                System.Console.WriteLine(0);
            }
        }
    }

    class Mountain
    {
        public int? Right { get; set; }
        public int Height { get; set; }
        public int? Water { get; set; }
        public double Area()
        {
            if (Water == null || Right == null)
            {
                return 0.0;
            }
            else
            {
                return Math.Abs((Math.Abs(Height - Water.Value) + Math.Abs(Right.Value - Water.Value)) / 2.0);
            }
        }
        public static IList<Mountain> Parse(string line)
        {
            var moutains = new List<Mountain>();
            var height = 0;
            for (int i = 0; i < line.Length; i++)
            {
                var next = height;
                if (line[i] == '\\')
                {
                    next--;
                }
                else if (line[i] == '/')
                {
                    next++;
                }

                moutains.Add(new Mountain()
                {
                    Height = height,
                    Right = next,
                });

                height = next;
            }

            moutains.Add(new Mountain()
            {
                Height = height,
            });

            return moutains;
        }
    }

    //static class Console
    //{
    //    static StreamReader reader = new StreamReader("input.txt");

    //    public static string ReadLine()
    //    {
    //        return reader.ReadLine();
    //    }
    //}
}

Measured memory_bytes: 11096