# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_3_D
# Areas on the Cross-Section Diagram
# Result:
import sys

class Stack(object):
    def __init__(self):
        self.store = []

    def push(self, val):
        self.store.append(val)

    def pop(self):
        if self.is_empty():
            return None
        return self.store.pop()

    def top(self):
        if self.is_empty():
            return None
        return self.store[len(self.store) - 1]

    def is_empty(self):
        if len(self.store) == 0:
            return True
        else:
            return False

    def to_list(self):
        return list(self.store)


### main
pools = []
s1 = Stack()
s2 = Stack()

line = sys.stdin.readline().rstrip()
area_sum = 0
idx = 0
for c in line:
    if c == '\\':
        s1.push(idx)
    elif c == '/':
        if not s1.is_empty():
            bs_idx = s1.pop()
            this_area_sum = idx - bs_idx
            area_sum += this_area_sum
            while (not s2.is_empty()) and (s2.top()[0] > bs_idx):
                this_area_sum += s2.pop()[1]
            s2.push((bs_idx, this_area_sum))
    else:
        pass
    idx += 1

print area_sum
s2_list = s2.to_list()
str = '%d' % (len(s2_list))
for e in s2.to_list():
    str += ' %d' % (e[1])
print str import sys sys class Stack(object):
    def __init__(self):
        self.store = []

    def push(self, val):
        self.store.append(val)

    def pop(self):
        if self.is_empty():
            return None
        return self.store.pop()

    def top(self):
        if self.is_empty():
            return None
        return self.store[len(self.store) - 1]

    def is_empty(self):
        if len(self.store) == 0:
            return True
        else:
            return False

    def to_list(self):
        return list(self.store)


### main Stack def __init__(self):
        self.store = []

     __init__ self.store = [] self.store self store [] self self def push(self, val):
        self.store.append(val)

     push self.store.append(val) self.store.append self.store self store append val self self val val def pop(self):
        if self.is_empty():
            return None
        return self.store.pop()

     pop if self.is_empty():
            return None
         self.is_empty() self.is_empty self is_empty return None None return self.store.pop() self.store.pop() self.store.pop self.store self store pop self self def top(self):
        if self.is_empty():
            return None
        return self.store[len(self.store) - 1]

     top if self.is_empty():
            return None
         self.is_empty() self.is_empty self is_empty return None None return self.store[len(self.store) - 1] self.store[len(self.store) - 1] self.store self store len(self.store) - 1 len(self.store) len self.store self store 1 self self def is_empty(self):
        if len(self.store) == 0:
            return True
        else:
            return False

     is_empty if len(self.store) == 0:
            return True
        else:
            return False

     len(self.store) == 0 len(self.store) len self.store self store 0 return True True return False False self self def to_list(self):
        return list(self.store)


### main to_list return list(self.store) list(self.store) list self.store self store self self object pools = [] pools [] s1 = Stack() s1 Stack() Stack s2 = Stack() s2 Stack() Stack line = sys.stdin.readline().rstrip() line sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip area_sum = 0 area_sum 0 idx = 0 idx 0 for c in line:
    if c == '\\':
        s1.push(idx)
    elif c == '/':
        if not s1.is_empty():
            bs_idx = s1.pop()
            this_area_sum = idx - bs_idx
            area_sum += this_area_sum
            while (not s2.is_empty()) and (s2.top()[0] > bs_idx):
                this_area_sum += s2.pop()[1]
            s2.push((bs_idx, this_area_sum))
    else:
        pass
    idx += 1 c line if c == '\\':
        s1.push(idx)
    elif c == '/':
        if not s1.is_empty():
            bs_idx = s1.pop()
            this_area_sum = idx - bs_idx
            area_sum += this_area_sum
            while (not s2.is_empty()) and (s2.top()[0] > bs_idx):
                this_area_sum += s2.pop()[1]
            s2.push((bs_idx, this_area_sum))
    else:
        pass
     c == '\\' c '\\' s1.push(idx) s1.push s1 push idx elif c == '/':
        if not s1.is_empty():
            bs_idx = s1.pop()
            this_area_sum = idx - bs_idx
            area_sum += this_area_sum
            while (not s2.is_empty()) and (s2.top()[0] > bs_idx):
                this_area_sum += s2.pop()[1]
            s2.push((bs_idx, this_area_sum))
     c == '/' c '/' if not s1.is_empty():
            bs_idx = s1.pop()
            this_area_sum = idx - bs_idx
            area_sum += this_area_sum
            while (not s2.is_empty()) and (s2.top()[0] > bs_idx):
                this_area_sum += s2.pop()[1]
            s2.push((bs_idx, this_area_sum))
     not s1.is_empty() s1.is_empty() s1.is_empty s1 is_empty bs_idx = s1.pop() bs_idx s1.pop() s1.pop s1 pop this_area_sum = idx - bs_idx this_area_sum idx - bs_idx idx bs_idx area_sum += this_area_sum area_sum this_area_sum while (not s2.is_empty()) and (s2.top()[0] > bs_idx):
                this_area_sum += s2.pop()[1]
             (not s2.is_empty()) and (s2.top()[0] > bs_idx) not s2.is_empty() s2.is_empty() s2.is_empty s2 is_empty s2.top()[0] > bs_idx s2.top()[0] s2.top() s2.top s2 top 0 bs_idx this_area_sum += s2.pop()[1] this_area_sum s2.pop()[1] s2.pop() s2.pop s2 pop 1 s2.push((bs_idx, this_area_sum)) s2.push s2 push (bs_idx, this_area_sum) bs_idx this_area_sum idx += 1 idx 1 print s2_list = s2.to_list() s2_list s2.to_list() s2.to_list s2 to_list str = '%d' % (len(s2_list)) str '%d' % (len(s2_list)) '%d' len(s2_list) len s2_list for e in s2.to_list():
    str += ' %d' % (e[1]) e s2.to_list() s2.to_list s2 to_list str += ' %d' % (e[1]) str ' %d' % (e[1]) ' %d' e[1] e 1 print idx = 0 0 idx s1 = Stack() Stack() s1 this_area_sum = idx - bs_idx idx - bs_idx this_area_sum this_area_sum += s2.pop()[1] s2.pop()[1] this_area_sum s2_list = s2.to_list() s2.to_list() s2_list class Stack(object):
    def __init__(self):
        self.store = []

    def push(self, val):
        self.store.append(val)

    def pop(self):
        if self.is_empty():
            return None
        return self.store.pop()

    def top(self):
        if self.is_empty():
            return None
        return self.store[len(self.store) - 1]

    def is_empty(self):
        if len(self.store) == 0:
            return True
        else:
            return False

    def to_list(self):
        return list(self.store)


### main class Stack(object):
    def __init__(self):
        self.store = []

    def push(self, val):
        self.store.append(val)

    def pop(self):
        if self.is_empty():
            return None
        return self.store.pop()

    def top(self):
        if self.is_empty():
            return None
        return self.store[len(self.store) - 1]

    def is_empty(self):
        if len(self.store) == 0:
            return True
        else:
            return False

    def to_list(self):
        return list(self.store)


### main Stack s2 = Stack() Stack() s2 idx += 1 1 idx str += ' %d' % (e[1]) ' %d' % (e[1]) str area_sum += this_area_sum this_area_sum area_sum pools = [] [] pools area_sum = 0 0 area_sum bs_idx = s1.pop() s1.pop() bs_idx str = '%d' % (len(s2_list)) '%d' % (len(s2_list)) str line = sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() line
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_3_D
# Areas on the Cross-Section Diagram
# Result:
import sys

class Stack(object):
    def __init__(self):
        self.store = []

    def push(self, val):
        self.store.append(val)

    def pop(self):
        if self.is_empty():
            return None
        return self.store.pop()

    def top(self):
        if self.is_empty():
            return None
        return self.store[len(self.store) - 1]

    def is_empty(self):
        if len(self.store) == 0:
            return True
        else:
            return False

    def to_list(self):
        return list(self.store)


### main
pools = []
s1 = Stack()
s2 = Stack()

line = sys.stdin.readline().rstrip()
area_sum = 0
idx = 0
for c in line:
    if c == '\\':
        s1.push(idx)
    elif c == '/':
        if not s1.is_empty():
            bs_idx = s1.pop()
            this_area_sum = idx - bs_idx
            area_sum += this_area_sum
            while (not s2.is_empty()) and (s2.top()[0] > bs_idx):
                this_area_sum += s2.pop()[1]
            s2.push((bs_idx, this_area_sum))
    else:
        pass
    idx += 1

print area_sum
s2_list = s2.to_list()
str = '%d' % (len(s2_list))
for e in s2.to_list():
    str += ' %d' % (e[1])
print str