a = input().strip()
stack = []
area = 0
area_list = []

for i, slope in enumerate(a):
    if slope == '\\':
        stack.append(i)
    elif slope == '/' and len(stack) != 0:
        ip = stack.pop(len(stack)-1)
        area += (i - ip)
        a = i - ip
        while len(area_list) != 0 and area_list[len(area_list)-1][0] > ip:
            temp = area_list.pop(len(area_list)-1)
            a += temp[1]
        area_list.append([ip, a])
    
print(area)
print('{}'.format(len(area_list)), end='')
if len(area_list) != 0:
    print(' ', end='')
print(' '.join([str(i[1]) for i in area_list]))
     a = input().strip() a input().strip() ().strip () input strip stack = [] stack [] area = 0 area 0 area_list = [] area_list [] for i, slope in enumerate(a):
    if slope == '\\':
        stack.append(i)
    elif slope == '/' and len(stack) != 0:
        ip = stack.pop(len(stack)-1)
        area += (i - ip)
        a = i - ip
        while len(area_list) != 0 and area_list[len(area_list)-1][0] > ip:
            temp = area_list.pop(len(area_list)-1)
            a += temp[1]
        area_list.append([ip, a])
     i slope enumerate(a) enumerate a if slope == '\\':
        stack.append(i)
    elif slope == '/' and len(stack) != 0:
        ip = stack.pop(len(stack)-1)
        area += (i - ip)
        a = i - ip
        while len(area_list) != 0 and area_list[len(area_list)-1][0] > ip:
            temp = area_list.pop(len(area_list)-1)
            a += temp[1]
        area_list.append([ip, a])
     slope == '\\' slope '\\' stack.append(i) stack.append stack append i elif slope == '/' and len(stack) != 0:
        ip = stack.pop(len(stack)-1)
        area += (i - ip)
        a = i - ip
        while len(area_list) != 0 and area_list[len(area_list)-1][0] > ip:
            temp = area_list.pop(len(area_list)-1)
            a += temp[1]
        area_list.append([ip, a])
     slope == '/' and len(stack) != 0 slope == '/' slope '/' len(stack) != 0 len(stack) len stack 0 ip = stack.pop(len(stack)-1) ip stack.pop(len(stack)-1) stack.pop stack pop len(stack)-1 len(stack) len stack 1 area += (i - ip) area i - ip i ip a = i - ip a i - ip i ip while len(area_list) != 0 and area_list[len(area_list)-1][0] > ip:
            temp = area_list.pop(len(area_list)-1)
            a += temp[1]
         len(area_list) != 0 and area_list[len(area_list)-1][0] > ip len(area_list) != 0 len(area_list) len area_list 0 area_list[len(area_list)-1][0] > ip area_list[len(area_list)-1][0] [len(area_list)-1] area_list len(area_list)-1 len(area_list) len area_list 1 0 ip temp = area_list.pop(len(area_list)-1) temp area_list.pop(len(area_list)-1) area_list.pop area_list pop len(area_list)-1 len(area_list) len area_list 1 a += temp[1] a temp[1] temp 1 area_list.append([ip, a]) area_list.append area_list append [ip, a] ip a print(area) print area print('{}'.format(len(area_list)), end='') print '{}'.format(len(area_list)) '{}'.format '{}' format len(area_list) len area_list end='' end '' if len(area_list) != 0:
    print(' ', end='') len(area_list) != 0 len(area_list) len area_list 0 print(' ', end='') print ' ' end='' end '' str(i[1]) for i in area_list for i in area_list i area_list for i in area_list str(i[1]) str i[1] i 1 print(' '.join([str(i[1]) for i in area_list])) print ' '.join([str(i[1]) for i in area_list]) ' '.join ' ' join [str(i[1]) for i in area_list] temp = area_list.pop(len(area_list)-1) area_list.pop(len(area_list)-1) temp a = input().strip() input().strip() a ip = stack.pop(len(stack)-1) stack.pop(len(stack)-1) ip area = 0 0 area area += (i - ip) i - ip area a = i - ip i - ip a stack = [] [] stack a += temp[1] temp[1] a area_list = [] [] area_list
a = input().strip()
stack = []
area = 0
area_list = []

for i, slope in enumerate(a):
    if slope == '\\':
        stack.append(i)
    elif slope == '/' and len(stack) != 0:
        ip = stack.pop(len(stack)-1)
        area += (i - ip)
        a = i - ip
        while len(area_list) != 0 and area_list[len(area_list)-1][0] > ip:
            temp = area_list.pop(len(area_list)-1)
            a += temp[1]
        area_list.append([ip, a])
    
print(area)
print('{}'.format(len(area_list)), end='')
if len(area_list) != 0:
    print(' ', end='')
print(' '.join([str(i[1]) for i in area_list]))
    
