# coding: utf-8
# Your code here!

x = input()
lst = list(x)
pt = []
rst = []
k = 0

# point get
cnt = 0
tmp = ""
for s in lst:
    if s == "/":
        if tmp == "_" or tmp == "/":
            cnt += 1
    elif s == "\\":
        if tmp == "\\":
            cnt -= 1
    else:
        if tmp == "\\":
            cnt -= 1

    pt += [cnt]
    tmp = s

#メンセキ
i,xs,m2 = 0,0,0
for s in lst:
    if s == "/":
        if i == xs and xs > 0:
            rst += [m2]
            k += 1
            xs,m2 = 0,0
    elif s == "_":
        pass
    else:
        try:
            x = pt[i+1:].index(pt[i])+i+1
            m2 += x-i
            if xs < x:
                xs = x
        except:
            pass
    i += 1
           
print(sum(rst))
print(k,*rst)
 x = input() x input() input lst = list(x) lst list(x) list x pt = [] pt [] rst = [] rst [] k = 0 k 0 cnt = 0 cnt 0 tmp = "" tmp "" for s in lst:
    if s == "/":
        if tmp == "_" or tmp == "/":
            cnt += 1
    elif s == "\\":
        if tmp == "\\":
            cnt -= 1
    else:
        if tmp == "\\":
            cnt -= 1

    pt += [cnt]
    tmp = s

#メンセキ s lst if s == "/":
        if tmp == "_" or tmp == "/":
            cnt += 1
    elif s == "\\":
        if tmp == "\\":
            cnt -= 1
    else:
        if tmp == "\\":
            cnt -= 1

     s == "/" s "/" if tmp == "_" or tmp == "/":
            cnt += 1
     tmp == "_" or tmp == "/" tmp == "_" tmp "_" tmp == "/" tmp "/" cnt += 1 cnt 1 elif s == "\\":
        if tmp == "\\":
            cnt -= 1
     s == "\\" s "\\" if tmp == "\\":
            cnt -= 1
     tmp == "\\" tmp "\\" cnt -= 1 cnt 1 if tmp == "\\":
            cnt -= 1

     tmp == "\\" tmp "\\" cnt -= 1 cnt 1 pt += [cnt] pt [cnt] cnt tmp = s tmp s i,xs,m2 = 0,0,0 i 0 xs 0 m2 0 for s in lst:
    if s == "/":
        if i == xs and xs > 0:
            rst += [m2]
            k += 1
            xs,m2 = 0,0
    elif s == "_":
        pass
    else:
        try:
            x = pt[i+1:].index(pt[i])+i+1
            m2 += x-i
            if xs < x:
                xs = x
        except:
            pass
    i += 1
            s lst if s == "/":
        if i == xs and xs > 0:
            rst += [m2]
            k += 1
            xs,m2 = 0,0
    elif s == "_":
        pass
    else:
        try:
            x = pt[i+1:].index(pt[i])+i+1
            m2 += x-i
            if xs < x:
                xs = x
        except:
            pass
     s == "/" s "/" if i == xs and xs > 0:
            rst += [m2]
            k += 1
            xs,m2 = 0,0
     i == xs and xs > 0 i == xs i xs xs > 0 xs 0 rst += [m2] rst [m2] m2 k += 1 k 1 xs,m2 = 0,0 xs 0 m2 0 elif s == "_":
        pass
     s == "_" s "_" try:
            x = pt[i+1:].index(pt[i])+i+1
            m2 += x-i
            if xs < x:
                xs = x
        except:
            pass
     except:
            pass
     x = pt[i+1:].index(pt[i])+i+1 x pt[i+1:].index(pt[i])+i+1 pt[i+1:].index(pt[i])+i pt[i+1:].index(pt[i]) [i+1:].index [i+1:] pt i+1: i+1 i 1 index pt[i] pt i i 1 m2 += x-i m2 x-i x i if xs < x:
                xs = x
         xs < x xs x xs = x xs x i += 1 i 1 print(sum(rst)) print sum(rst) sum rst print(k,*rst) print k *rst rst pt += [cnt] [cnt] pt x = pt[i+1:].index(pt[i])+i+1 pt[i+1:].index(pt[i])+i+1 x cnt += 1 1 cnt i,xs,m2 = 0,0,0 0 i tmp = "" "" tmp cnt = 0 0 cnt i += 1 1 i rst = [] [] rst tmp = s s tmp lst = list(x) list(x) lst m2 = 0,0 0 m2 k = 0 0 k k += 1 1 k x = input() input() x xs = x x xs pt = [] [] pt cnt -= 1 1 cnt cnt -= 1 1 cnt xs,m2 = 0,0,0 0 xs m2 = 0,0,0 0 m2 xs,m2 = 0,0 0 xs m2 += x-i x-i m2 rst += [m2] [m2] rst
# coding: utf-8
# Your code here!

x = input()
lst = list(x)
pt = []
rst = []
k = 0

# point get
cnt = 0
tmp = ""
for s in lst:
    if s == "/":
        if tmp == "_" or tmp == "/":
            cnt += 1
    elif s == "\\":
        if tmp == "\\":
            cnt -= 1
    else:
        if tmp == "\\":
            cnt -= 1

    pt += [cnt]
    tmp = s

#メンセキ
i,xs,m2 = 0,0,0
for s in lst:
    if s == "/":
        if i == xs and xs > 0:
            rst += [m2]
            k += 1
            xs,m2 = 0,0
    elif s == "_":
        pass
    else:
        try:
            x = pt[i+1:].index(pt[i])+i+1
            m2 += x-i
            if xs < x:
                xs = x
        except:
            pass
    i += 1
           
print(sum(rst))
print(k,*rst)

