s = input()

st = []
leftn = 0

def pushv(s, x):
        tmp = s.pop()
        tmpsum = 0
        while tmp[0] != 'left':
                tmpsum += tmp[1]
                tmp = s.pop()
        else:
                tmpsum += x - tmp[1]
                s.append(('v', tmpsum))

for x in range(len(s)):
        if s[x] == '\\':
                st.append(('left', x))
                leftn += 1
        elif s[x] == '/':
                if leftn != 0:
                        pushv(st, x)
                        leftn -= 1

st = [x[1] for x in st if x[0] == 'v']

if len(st) != 0:
       print(sum(st))
       print(len(st), ' '.join([str(x) for x in st]))
else:
      print(0)
      print(0) s = input() s input() input st = [] st [] leftn = 0 leftn 0 def pushv(s, x):
        tmp = s.pop()
        tmpsum = 0
        while tmp[0] != 'left':
                tmpsum += tmp[1]
                tmp = s.pop()
        else:
                tmpsum += x - tmp[1]
                s.append(('v', tmpsum)) pushv tmp = s.pop() tmp s.pop() s.pop s pop tmpsum = 0 tmpsum 0 while tmp[0] != 'left':
                tmpsum += tmp[1]
                tmp = s.pop()
        else:
                tmpsum += x - tmp[1]
                s.append(('v', tmpsum)) tmp[0] != 'left' tmp[0] tmp 0 'left' tmpsum += tmp[1] tmpsum tmp[1] tmp 1 tmp = s.pop() tmp s.pop() s.pop s pop tmpsum += x - tmp[1] tmpsum x - tmp[1] x tmp[1] tmp 1 s.append(('v', tmpsum)) s.append s append ('v', tmpsum) 'v' tmpsum s s x x for x in range(len(s)):
        if s[x] == '\\':
                st.append(('left', x))
                leftn += 1
        elif s[x] == '/':
                if leftn != 0:
                        pushv(st, x)
                        leftn -= 1 x range(len(s)) range len(s) len s if s[x] == '\\':
                st.append(('left', x))
                leftn += 1
        elif s[x] == '/':
                if leftn != 0:
                        pushv(st, x)
                        leftn -= 1 s[x] == '\\' s[x] s x '\\' st.append(('left', x)) st.append st append ('left', x) 'left' x leftn += 1 leftn 1 elif s[x] == '/':
                if leftn != 0:
                        pushv(st, x)
                        leftn -= 1 s[x] == '/' s[x] s x '/' if leftn != 0:
                        pushv(st, x)
                        leftn -= 1 leftn != 0 leftn 0 pushv(st, x) pushv st x leftn -= 1 leftn 1 x[1] for x in st if x[0] == 'v' for x in st if x[0] == 'v' x st x[0] == 'v' x[0] x 0 'v' if x[0] == 'v' x[1] x 1 st = [x[1] for x in st if x[0] == 'v'] st [x[1] for x in st if x[0] == 'v'] if len(st) != 0:
       print(sum(st))
       print(len(st), ' '.join([str(x) for x in st]))
else:
      print(0)
      print(0) len(st) != 0 len(st) len st 0 print(sum(st)) print sum(st) sum st str(x) for x in st for x in st x st for x in st str(x) str x print(len(st), ' '.join([str(x) for x in st])) print len(st) len st ' '.join([str(x) for x in st]) ' '.join ' ' join [str(x) for x in st] print(0) print 0 print(0) print 0 s = input() input() s st = [] [] st st = [x[1] for x in st if x[0] == 'v'] [x[1] for x in st if x[0] == 'v'] st leftn = 0 0 leftn leftn -= 1 1 leftn leftn += 1 1 leftn def pushv(s, x):
        tmp = s.pop()
        tmpsum = 0
        while tmp[0] != 'left':
                tmpsum += tmp[1]
                tmp = s.pop()
        else:
                tmpsum += x - tmp[1]
                s.append(('v', tmpsum)) def pushv(s, x):
        tmp = s.pop()
        tmpsum = 0
        while tmp[0] != 'left':
                tmpsum += tmp[1]
                tmp = s.pop()
        else:
                tmpsum += x - tmp[1]
                s.append(('v', tmpsum)) pushv
s = input()

st = []
leftn = 0

def pushv(s, x):
        tmp = s.pop()
        tmpsum = 0
        while tmp[0] != 'left':
                tmpsum += tmp[1]
                tmp = s.pop()
        else:
                tmpsum += x - tmp[1]
                s.append(('v', tmpsum))

for x in range(len(s)):
        if s[x] == '\\':
                st.append(('left', x))
                leftn += 1
        elif s[x] == '/':
                if leftn != 0:
                        pushv(st, x)
                        leftn -= 1

st = [x[1] for x in st if x[0] == 'v']

if len(st) != 0:
       print(sum(st))
       print(len(st), ' '.join([str(x) for x in st]))
else:
      print(0)
      print(0)