use std::io::*;
use std::str::FromStr;
#[allow(unused_imports)]
use std::collections::*;
#[allow(unused_imports)]
use std::cmp::{min, max};

struct Scanner<R: Read> {
    reader: R,
    buffer: String,
}

#[allow(dead_code)]
impl<R: Read> Scanner<R> {
    fn new(reader: R) -> Scanner<R> {
        Scanner { reader: reader, buffer: String::new() }
    }

    // fn line(&mut self) -> String {
    //     self.buffer = self.reader.by_ref().bytes().map(|c| c.unwrap() as char)
    //         .skip_while(|&c| c == '\n' || c == '\r')
    //         .take_while(|&c| !(c == '\n' || c == '\r'))
    //         .collect::<String>();
    //     self.buffer.clone()
    // }

    fn read_buffer(&mut self) {
        self.buffer = self.reader.by_ref().bytes().map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
    }

    fn safe_read<T: FromStr>(&mut self) -> Option<T> {
        self.read_buffer();
        if self.buffer.is_empty() {
            None
        } else {
            self.buffer.parse::<T>().ok()
        }
    }

    fn read<T: FromStr>(&mut self) -> T {
        if let Some(s) = self.safe_read() {
            s
        } else {
            writeln!(std::io::stderr(), "Terminated with EOF").unwrap();
            std::process::exit(0);
        }
    }

    fn vec<T: FromStr>(&mut self, len: usize) -> Vec<T> {
        (0..len).map(|_| self.read()).collect()
    }

    fn mat<T: FromStr>(&mut self, row: usize, col: usize) -> Vec<Vec<T>> {
        (0..row).map(|_| self.vec(col)).collect()
    }
}

trait Joinable {
    fn join(self, sep: &str) -> String;
}

impl<U: ToString, T: Iterator<Item=U>> Joinable for T {
    fn join(self, sep: &str) -> String {
        self.map(|x| x.to_string()).collect::<Vec<_>>().join(sep)
    }
}

fn main() {
    std::thread::Builder::new()
        .stack_size(104_857_600)
        .spawn(solve)
        .unwrap()
        .join()
        .unwrap();
}

fn solve() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);

    let a: Vec<_> = sc.read::<String>().chars().collect();
    let mut ranges: Vec<(usize, usize)> = vec![];
    let mut stack = vec![];
    for (i, &x) in a.iter().enumerate() {
        match x {
            '\\' => stack.push(i),
            '/' => {
                if let Some(left) = stack.pop() {
                    if stack.is_empty() {
                        ranges.push((left, i));
                    }
                }
            },
            _ => (),
        }
    }
    stack.clear();
    for (i, &x) in a.iter().enumerate().rev() {
        match x {
            '/' => stack.push(i),
            '\\' => {
                if let Some(right) = stack.pop() {
                    if stack.is_empty() {
                        ranges.push((i, right));
                    }
                }
            },
            _ => (),
        }
    }
    ranges.sort();
    ranges.dedup();

    let ans: Vec<_> = ranges.iter().map(|&(l, r)| {
        let mut sum2 = 0;
        let mut depth = 0;
        for &x in a[l..r+1].iter() {
            match x {
                '\\' => {
                    sum2 += depth * 2 + 1;
                    depth += 1;
                },
                '/' => {
                    sum2 += depth * 2 - 1;
                    depth -= 1;
                },
                _ => {
                    sum2 += depth * 2;
                },
            }
        }
        sum2 / 2
    }).collect();

    let sum = ans.iter().sum::<u32>();
    println!("{}", sum);
    if ans.len() > 0 {
        println!("{} {}", ans.len(), ans.iter().join(" "));
    } else {
        println!("{}", ans.len());
    }
}



Measured memory_bytes: 9092