# encoding: utf-8


def calc_area(startIndex, endIndex, terrain):
    level = terrain[startIndex]
    area = 0
    for i in xrange(startIndex, endIndex):
        area += (level - terrain[i]) + 0.5 * (terrain[i] - terrain[i + 1])
    return int(area)


def check_area(terrain):
    i = 0
    startIndex = 0
    endIndex = 0
    while i < len(terrain) - 1:
        if terrain[i + 1] - terrain[i] < 0:
            startIndex = i
            break
        i += 1
    for j in xrange(i + 1, len(terrain)):
        if terrain[i] == terrain[j]:
            endIndex = j
            return startIndex, endIndex
    else:
        return 0, 0


def main():
    string = list(raw_input())
    terrain = []
    height = 0
    for c in string:
        terrain.append(height)
        if c == "\\":
            height -= 1
        elif c == "/":
            height += 1
    terrain.append(height)

    waterAreaRight = []
    while True:
        i, j = check_area(terrain)
        if i == j:
            break
        waterAreaRight.append(calc_area(i, j, terrain))
        terrain = terrain[j:]

    terrain = terrain[::-1]
    waterAreaLeft = []
    while True:
        i, j = check_area(terrain)
        if i == j:
            break
        waterAreaLeft.append(calc_area(i, j, terrain))
        terrain = terrain[j:]
    waterAreaRight.extend(waterAreaLeft[::-1])

    print sum(waterAreaRight)
    print len(waterAreaRight),
    if len(waterAreaRight) > 0:
        print " ".join(map(str, waterAreaRight))

main() def calc_area(startIndex, endIndex, terrain):
    level = terrain[startIndex]
    area = 0
    for i in xrange(startIndex, endIndex):
        area += (level - terrain[i]) + 0.5 * (terrain[i] - terrain[i + 1])
    return int(area) calc_area level = terrain[startIndex] level terrain[startIndex] terrain startIndex area = 0 area 0 for i in xrange(startIndex, endIndex):
        area += (level - terrain[i]) + 0.5 * (terrain[i] - terrain[i + 1])
     i xrange(startIndex, endIndex) xrange startIndex endIndex area += (level - terrain[i]) + 0.5 * (terrain[i] - terrain[i + 1]) area (level - terrain[i]) + 0.5 * (terrain[i] - terrain[i + 1]) level - terrain[i] level terrain[i] terrain i 0.5 * (terrain[i] - terrain[i + 1]) 0.5 terrain[i] - terrain[i + 1] terrain[i] terrain i terrain[i + 1] terrain i + 1 i 1 return int(area) int(area) int area startIndex startIndex endIndex endIndex terrain terrain def check_area(terrain):
    i = 0
    startIndex = 0
    endIndex = 0
    while i < len(terrain) - 1:
        if terrain[i + 1] - terrain[i] < 0:
            startIndex = i
            break
        i += 1
    for j in xrange(i + 1, len(terrain)):
        if terrain[i] == terrain[j]:
            endIndex = j
            return startIndex, endIndex
    else:
        return 0, 0 check_area i = 0 i 0 startIndex = 0 startIndex 0 endIndex = 0 endIndex 0 while i < len(terrain) - 1:
        if terrain[i + 1] - terrain[i] < 0:
            startIndex = i
            break
        i += 1
     i < len(terrain) - 1 i len(terrain) - 1 len(terrain) len terrain 1 if terrain[i + 1] - terrain[i] < 0:
            startIndex = i
            break
         terrain[i + 1] - terrain[i] < 0 terrain[i + 1] - terrain[i] terrain[i + 1] terrain i + 1 i 1 terrain[i] terrain i 0 startIndex = i startIndex i break i += 1 i 1 for j in xrange(i + 1, len(terrain)):
        if terrain[i] == terrain[j]:
            endIndex = j
            return startIndex, endIndex
    else:
        return 0, 0 j xrange(i + 1, len(terrain)) xrange i + 1 i 1 len(terrain) len terrain if terrain[i] == terrain[j]:
            endIndex = j
            return startIndex, endIndex
     terrain[i] == terrain[j] terrain[i] terrain i terrain[j] terrain j endIndex = j endIndex j return startIndex, endIndex return startIndex, endIndex startIndex endIndex return 0, 0 return 0, 0 0 0 terrain terrain def main():
    string = list(raw_input())
    terrain = []
    height = 0
    for c in string:
        terrain.append(height)
        if c == "\\":
            height -= 1
        elif c == "/":
            height += 1
    terrain.append(height)

    waterAreaRight = []
    while True:
        i, j = check_area(terrain)
        if i == j:
            break
        waterAreaRight.append(calc_area(i, j, terrain))
        terrain = terrain[j:]

    terrain = terrain[::-1]
    waterAreaLeft = []
    while True:
        i, j = check_area(terrain)
        if i == j:
            break
        waterAreaLeft.append(calc_area(i, j, terrain))
        terrain = terrain[j:]
    waterAreaRight.extend(waterAreaLeft[::-1])

    print sum(waterAreaRight)
    print len(waterAreaRight),
    if len(waterAreaRight) > 0:
        print " ".join(map(str, waterAreaRight)) main string = list(raw_input()) string list(raw_input()) list raw_input() raw_input terrain = [] terrain [] height = 0 height 0 for c in string:
        terrain.append(height)
        if c == "\\":
            height -= 1
        elif c == "/":
            height += 1
     c string terrain.append(height) terrain.append terrain append height if c == "\\":
            height -= 1
        elif c == "/":
            height += 1
     c == "\\" c "\\" height -= 1 height 1 elif c == "/":
            height += 1
     c == "/" c "/" height += 1 height 1 terrain.append(height) terrain.append terrain append height waterAreaRight = [] waterAreaRight [] while True:
        i, j = check_area(terrain)
        if i == j:
            break
        waterAreaRight.append(calc_area(i, j, terrain))
        terrain = terrain[j:]

     True i, j = check_area(terrain) i check_area(terrain) check_area terrain j if i == j:
            break
         i == j i j break waterAreaRight.append(calc_area(i, j, terrain)) waterAreaRight.append waterAreaRight append calc_area(i, j, terrain) calc_area i j terrain terrain = terrain[j:] terrain terrain[j:] terrain j: j terrain = terrain[::-1] terrain terrain[::-1] terrain ::-1 -1 waterAreaLeft = [] waterAreaLeft [] while True:
        i, j = check_area(terrain)
        if i == j:
            break
        waterAreaLeft.append(calc_area(i, j, terrain))
        terrain = terrain[j:]
     True i, j = check_area(terrain) i check_area(terrain) check_area terrain j if i == j:
            break
         i == j i j break waterAreaLeft.append(calc_area(i, j, terrain)) waterAreaLeft.append waterAreaLeft append calc_area(i, j, terrain) calc_area i j terrain terrain = terrain[j:] terrain terrain[j:] terrain j: j waterAreaRight.extend(waterAreaLeft[::-1]) waterAreaRight.extend waterAreaRight extend waterAreaLeft[::-1] waterAreaLeft ::-1 -1 print sum(waterAreaRight) sum waterAreaRight print len(waterAreaRight) len waterAreaRight if len(waterAreaRight) > 0:
        print " ".join(map(str, waterAreaRight)) len(waterAreaRight) > 0 len(waterAreaRight) len waterAreaRight 0 print " ".join(map(str, waterAreaRight)) " ".join " " join map(str, waterAreaRight) map str waterAreaRight main() main def main():
    string = list(raw_input())
    terrain = []
    height = 0
    for c in string:
        terrain.append(height)
        if c == "\\":
            height -= 1
        elif c == "/":
            height += 1
    terrain.append(height)

    waterAreaRight = []
    while True:
        i, j = check_area(terrain)
        if i == j:
            break
        waterAreaRight.append(calc_area(i, j, terrain))
        terrain = terrain[j:]

    terrain = terrain[::-1]
    waterAreaLeft = []
    while True:
        i, j = check_area(terrain)
        if i == j:
            break
        waterAreaLeft.append(calc_area(i, j, terrain))
        terrain = terrain[j:]
    waterAreaRight.extend(waterAreaLeft[::-1])

    print sum(waterAreaRight)
    print len(waterAreaRight),
    if len(waterAreaRight) > 0:
        print " ".join(map(str, waterAreaRight)) def main():
    string = list(raw_input())
    terrain = []
    height = 0
    for c in string:
        terrain.append(height)
        if c == "\\":
            height -= 1
        elif c == "/":
            height += 1
    terrain.append(height)

    waterAreaRight = []
    while True:
        i, j = check_area(terrain)
        if i == j:
            break
        waterAreaRight.append(calc_area(i, j, terrain))
        terrain = terrain[j:]

    terrain = terrain[::-1]
    waterAreaLeft = []
    while True:
        i, j = check_area(terrain)
        if i == j:
            break
        waterAreaLeft.append(calc_area(i, j, terrain))
        terrain = terrain[j:]
    waterAreaRight.extend(waterAreaLeft[::-1])

    print sum(waterAreaRight)
    print len(waterAreaRight),
    if len(waterAreaRight) > 0:
        print " ".join(map(str, waterAreaRight)) main def check_area(terrain):
    i = 0
    startIndex = 0
    endIndex = 0
    while i < len(terrain) - 1:
        if terrain[i + 1] - terrain[i] < 0:
            startIndex = i
            break
        i += 1
    for j in xrange(i + 1, len(terrain)):
        if terrain[i] == terrain[j]:
            endIndex = j
            return startIndex, endIndex
    else:
        return 0, 0 def check_area(terrain):
    i = 0
    startIndex = 0
    endIndex = 0
    while i < len(terrain) - 1:
        if terrain[i + 1] - terrain[i] < 0:
            startIndex = i
            break
        i += 1
    for j in xrange(i + 1, len(terrain)):
        if terrain[i] == terrain[j]:
            endIndex = j
            return startIndex, endIndex
    else:
        return 0, 0 check_area def calc_area(startIndex, endIndex, terrain):
    level = terrain[startIndex]
    area = 0
    for i in xrange(startIndex, endIndex):
        area += (level - terrain[i]) + 0.5 * (terrain[i] - terrain[i + 1])
    return int(area) def calc_area(startIndex, endIndex, terrain):
    level = terrain[startIndex]
    area = 0
    for i in xrange(startIndex, endIndex):
        area += (level - terrain[i]) + 0.5 * (terrain[i] - terrain[i + 1])
    return int(area) calc_area
# encoding: utf-8


def calc_area(startIndex, endIndex, terrain):
    level = terrain[startIndex]
    area = 0
    for i in xrange(startIndex, endIndex):
        area += (level - terrain[i]) + 0.5 * (terrain[i] - terrain[i + 1])
    return int(area)


def check_area(terrain):
    i = 0
    startIndex = 0
    endIndex = 0
    while i < len(terrain) - 1:
        if terrain[i + 1] - terrain[i] < 0:
            startIndex = i
            break
        i += 1
    for j in xrange(i + 1, len(terrain)):
        if terrain[i] == terrain[j]:
            endIndex = j
            return startIndex, endIndex
    else:
        return 0, 0


def main():
    string = list(raw_input())
    terrain = []
    height = 0
    for c in string:
        terrain.append(height)
        if c == "\\":
            height -= 1
        elif c == "/":
            height += 1
    terrain.append(height)

    waterAreaRight = []
    while True:
        i, j = check_area(terrain)
        if i == j:
            break
        waterAreaRight.append(calc_area(i, j, terrain))
        terrain = terrain[j:]

    terrain = terrain[::-1]
    waterAreaLeft = []
    while True:
        i, j = check_area(terrain)
        if i == j:
            break
        waterAreaLeft.append(calc_area(i, j, terrain))
        terrain = terrain[j:]
    waterAreaRight.extend(waterAreaLeft[::-1])

    print sum(waterAreaRight)
    print len(waterAreaRight),
    if len(waterAreaRight) > 0:
        print " ".join(map(str, waterAreaRight))

main()