#![allow(unused_imports)]
use std::cmp;
use std::collections::*;
use std::io::*;
use std::mem::swap;
#[allow(dead_code)]
struct Io<'a> {
    r: BufReader<StdinLock<'a>>,
    w: BufWriter<StdoutLock<'a>>,
    buf: VecDeque<String>,
    buf_str: String,
}
#[allow(dead_code)]
impl<'a> Io<'a> {
    fn r<T: std::str::FromStr>(&mut self) -> T {
        if self.buf.len() == 0 {
            self.r.read_line(&mut self.buf_str).unwrap();
            for w in self.buf_str.split_whitespace() {
                self.buf.push_back(w.to_owned());
            }
            self.buf_str.clear();
        }
        self.buf
            .pop_front()
            .unwrap()
            .parse()
            .unwrap_or_else(|_| panic!())
    }
    fn r_s(&mut self) -> String {
        if self.buf.len() == 0 {
            self.r.read_line(&mut self.buf_str).unwrap();
            for w in self.buf_str.split_whitespace() {
                self.buf.push_back(w.to_owned());
            }
            self.buf_str.clear();
        }
        self.buf.pop_front().unwrap()
    }
    fn w<T: std::fmt::Display>(&mut self, v: T) {
        write!(self.w, "{}", v).unwrap();
    }
    fn wl<T: std::fmt::Display>(&mut self, v: T) {
        writeln!(self.w, "{}", v).unwrap();
    }
    fn iter<'b, T: std::str::FromStr>(&'b mut self) -> IoIter<'a, 'b, T> {
        IoIter {
            io: self,
            p: std::marker::PhantomData,
        }
    }
}
#[allow(dead_code)]
struct IoIter<'a: 'b, 'b, T: std::str::FromStr> {
    io: &'b mut Io<'a>,
    p: std::marker::PhantomData<T>,
}
#[allow(dead_code)]
impl<'a, 'b, T: std::str::FromStr> Iterator for IoIter<'a, 'b, T> {
    type Item = T;
    fn next(&mut self) -> Option<T> {
        Some(self.io.r())
    }
}
fn main() {
    let stdin = stdin();
    let stdout = stdout();
    let r = BufReader::new(stdin.lock());
    let w = BufWriter::new(stdout.lock());
    let io = Io {
        r,
        w,
        buf: VecDeque::new(),
        buf_str: String::new(),
    };
    unsafe {
        problem(io);
    }
}

unsafe fn problem(mut io: Io) {
    let ter: Vec<char> = io.r_s().chars().collect();

    let mut puddles = Vec::new();

    let mut water_height = 0;
    let mut i = 0;
    'b: loop {
        if i == ter.len() {
            io.wl(puddles.iter().sum::<i32>());
            io.w(puddles.len());
            for p in puddles {
                io.w(' ');
                io.w(p);
            }
            io.w('\n');
            return;
        }

        match ter[i] {
            '/' => water_height += 1,
            '\\' => {
                let mut j = i;
                let mut water = 0;
                let mut height = water_height;
                loop {
                    if j == ter.len() {
                        i += 1;
                        continue 'b;
                    }
                    match ter[j] {
                        '/' => {
                            height += 1;
                            water += (water_height - height) * 2 + 1;
                        }
                        '\\' => {
                            height -= 1;
                            water += (water_height - height) * 2 - 1;
                        }
                        _ => {
                            water += (water_height - height) * 2;
                        }
                    }
                    if height == water_height {
                        puddles.push(water / 2);
                        i = j + 1;
                        continue 'b;
                    }
                    j += 1;
                }
            }
            _ => (),
        }
        i += 1;
    }
}



Measured memory_bytes: 5036