def flood(region_data,flood_data):
    height = 0
    water_num=0
    top=0
    i=-1
    for data in region_data:
        i+=1
        if(data=="\\"):
            if(height==0):
                top=i
            water_num+=height +0.5
            height+=1


        elif(data=="/"):
            if(height>=2):
                water_num+=height-0.5
                height-=1
            elif(height==1):
                water_num+=0.5
                flood_data.append(water_num)
                water_num=0
                height=0


        elif(data=="_"):
            water_num+=height
    if(height==0):
        top=-1
    return top







def flood2(region_data,flood_data):
    height = 0
    water_num=0
    top=0
    i=-1
    for data in region_data:
        i+=1
        if(data=="/"):
            if(height==0):
                top=i
            water_num+=height +0.5
            height+=1


        elif(data=="\\"):
            if(height>=2):
                water_num+=height-0.5
                height-=1
            elif(height==1):
                water_num+=0.5
                flood_data.append(water_num)
                water_num=0
                height=0


        elif(data=="_"):
            water_num+=height
    if(height==0):
        top=-1
    return top


region_data=list(input())
flood_data=[]
top=flood(region_data,flood_data)


if(top!=-1):
    region_data2=region_data[top:len(region_data)]
    region_data2.reverse()
    flood_data2=[]
    flood2(region_data2,flood_data2)
    flood_data2.reverse()
    flood_data_final=flood_data + flood_data2
else:
    flood_data_final=flood_data

flood_data_final=list(map(int,flood_data_final))
total=sum(flood_data_final)
num=[len(flood_data_final)]
flood_data_final=" ".join(list(map(str,num+flood_data_final)))

print(total)
print(f"{flood_data_final}") def flood(region_data,flood_data):
    height = 0
    water_num=0
    top=0
    i=-1
    for data in region_data:
        i+=1
        if(data=="\\"):
            if(height==0):
                top=i
            water_num+=height +0.5
            height+=1


        elif(data=="/"):
            if(height>=2):
                water_num+=height-0.5
                height-=1
            elif(height==1):
                water_num+=0.5
                flood_data.append(water_num)
                water_num=0
                height=0


        elif(data=="_"):
            water_num+=height
    if(height==0):
        top=-1
    return top flood height = 0 height 0 water_num=0 water_num 0 top=0 top 0 i=-1 i -1 for data in region_data:
        i+=1
        if(data=="\\"):
            if(height==0):
                top=i
            water_num+=height +0.5
            height+=1


        elif(data=="/"):
            if(height>=2):
                water_num+=height-0.5
                height-=1
            elif(height==1):
                water_num+=0.5
                flood_data.append(water_num)
                water_num=0
                height=0


        elif(data=="_"):
            water_num+=height
     data region_data i+=1 i 1 if(data=="\\"):
            if(height==0):
                top=i
            water_num+=height +0.5
            height+=1


        elif(data=="/"):
            if(height>=2):
                water_num+=height-0.5
                height-=1
            elif(height==1):
                water_num+=0.5
                flood_data.append(water_num)
                water_num=0
                height=0


        elif(data=="_"):
            water_num+=height
     data=="\\" data "\\" if(height==0):
                top=i
             height==0 height 0 top=i top i water_num+=height +0.5 water_num height +0.5 height 0.5 height+=1 height 1 elif(data=="/"):
            if(height>=2):
                water_num+=height-0.5
                height-=1
            elif(height==1):
                water_num+=0.5
                flood_data.append(water_num)
                water_num=0
                height=0


         data=="/" data "/" if(height>=2):
                water_num+=height-0.5
                height-=1
            elif(height==1):
                water_num+=0.5
                flood_data.append(water_num)
                water_num=0
                height=0


         height>=2 height 2 water_num+=height-0.5 water_num height-0.5 height 0.5 height-=1 height 1 elif(height==1):
                water_num+=0.5
                flood_data.append(water_num)
                water_num=0
                height=0


         height==1 height 1 water_num+=0.5 water_num 0.5 flood_data.append(water_num) flood_data.append flood_data append water_num water_num=0 water_num 0 height=0 height 0 elif(data=="_"):
            water_num+=height
     data=="_" data "_" water_num+=height water_num height if(height==0):
        top=-1
     height==0 height 0 top=-1 top -1 return top top region_data region_data flood_data flood_data def flood2(region_data,flood_data):
    height = 0
    water_num=0
    top=0
    i=-1
    for data in region_data:
        i+=1
        if(data=="/"):
            if(height==0):
                top=i
            water_num+=height +0.5
            height+=1


        elif(data=="\\"):
            if(height>=2):
                water_num+=height-0.5
                height-=1
            elif(height==1):
                water_num+=0.5
                flood_data.append(water_num)
                water_num=0
                height=0


        elif(data=="_"):
            water_num+=height
    if(height==0):
        top=-1
    return top flood2 height = 0 height 0 water_num=0 water_num 0 top=0 top 0 i=-1 i -1 for data in region_data:
        i+=1
        if(data=="/"):
            if(height==0):
                top=i
            water_num+=height +0.5
            height+=1


        elif(data=="\\"):
            if(height>=2):
                water_num+=height-0.5
                height-=1
            elif(height==1):
                water_num+=0.5
                flood_data.append(water_num)
                water_num=0
                height=0


        elif(data=="_"):
            water_num+=height
     data region_data i+=1 i 1 if(data=="/"):
            if(height==0):
                top=i
            water_num+=height +0.5
            height+=1


        elif(data=="\\"):
            if(height>=2):
                water_num+=height-0.5
                height-=1
            elif(height==1):
                water_num+=0.5
                flood_data.append(water_num)
                water_num=0
                height=0


        elif(data=="_"):
            water_num+=height
     data=="/" data "/" if(height==0):
                top=i
             height==0 height 0 top=i top i water_num+=height +0.5 water_num height +0.5 height 0.5 height+=1 height 1 elif(data=="\\"):
            if(height>=2):
                water_num+=height-0.5
                height-=1
            elif(height==1):
                water_num+=0.5
                flood_data.append(water_num)
                water_num=0
                height=0


         data=="\\" data "\\" if(height>=2):
                water_num+=height-0.5
                height-=1
            elif(height==1):
                water_num+=0.5
                flood_data.append(water_num)
                water_num=0
                height=0


         height>=2 height 2 water_num+=height-0.5 water_num height-0.5 height 0.5 height-=1 height 1 elif(height==1):
                water_num+=0.5
                flood_data.append(water_num)
                water_num=0
                height=0


         height==1 height 1 water_num+=0.5 water_num 0.5 flood_data.append(water_num) flood_data.append flood_data append water_num water_num=0 water_num 0 height=0 height 0 elif(data=="_"):
            water_num+=height
     data=="_" data "_" water_num+=height water_num height if(height==0):
        top=-1
     height==0 height 0 top=-1 top -1 return top top region_data region_data flood_data flood_data region_data=list(input()) region_data list(input()) list input() input flood_data=[] flood_data [] top=flood(region_data,flood_data) top flood(region_data,flood_data) flood region_data flood_data if(top!=-1):
    region_data2=region_data[top:len(region_data)]
    region_data2.reverse()
    flood_data2=[]
    flood2(region_data2,flood_data2)
    flood_data2.reverse()
    flood_data_final=flood_data + flood_data2
else:
    flood_data_final=flood_data top!=-1 top -1 region_data2=region_data[top:len(region_data)] region_data2 region_data[top:len(region_data)] region_data top:len(region_data) top len(region_data) len region_data region_data2.reverse() region_data2.reverse region_data2 reverse flood_data2=[] flood_data2 [] flood2(region_data2,flood_data2) flood2 region_data2 flood_data2 flood_data2.reverse() flood_data2.reverse flood_data2 reverse flood_data_final=flood_data + flood_data2 flood_data_final flood_data + flood_data2 flood_data flood_data2 flood_data_final=flood_data flood_data_final flood_data flood_data_final=list(map(int,flood_data_final)) flood_data_final list(map(int,flood_data_final)) list map(int,flood_data_final) map int flood_data_final total=sum(flood_data_final) total sum(flood_data_final) sum flood_data_final num=[len(flood_data_final)] num [len(flood_data_final)] len(flood_data_final) len flood_data_final flood_data_final=" ".join(list(map(str,num+flood_data_final))) flood_data_final " ".join(list(map(str,num+flood_data_final))) " ".join " " join list(map(str,num+flood_data_final)) list map(str,num+flood_data_final) map str num+flood_data_final num flood_data_final print(total) print total print(f"{flood_data_final}") print f"{flood_data_final}" flood_data_final=list(map(int,flood_data_final)) list(map(int,flood_data_final)) flood_data_final flood_data_final=flood_data flood_data flood_data_final region_data2=region_data[top:len(region_data)] region_data[top:len(region_data)] region_data2 flood_data=[] [] flood_data flood_data_final=" ".join(list(map(str,num+flood_data_final))) " ".join(list(map(str,num+flood_data_final))) flood_data_final num=[len(flood_data_final)] [len(flood_data_final)] num flood_data2=[] [] flood_data2 def flood(region_data,flood_data):
    height = 0
    water_num=0
    top=0
    i=-1
    for data in region_data:
        i+=1
        if(data=="\\"):
            if(height==0):
                top=i
            water_num+=height +0.5
            height+=1


        elif(data=="/"):
            if(height>=2):
                water_num+=height-0.5
                height-=1
            elif(height==1):
                water_num+=0.5
                flood_data.append(water_num)
                water_num=0
                height=0


        elif(data=="_"):
            water_num+=height
    if(height==0):
        top=-1
    return top def flood(region_data,flood_data):
    height = 0
    water_num=0
    top=0
    i=-1
    for data in region_data:
        i+=1
        if(data=="\\"):
            if(height==0):
                top=i
            water_num+=height +0.5
            height+=1


        elif(data=="/"):
            if(height>=2):
                water_num+=height-0.5
                height-=1
            elif(height==1):
                water_num+=0.5
                flood_data.append(water_num)
                water_num=0
                height=0


        elif(data=="_"):
            water_num+=height
    if(height==0):
        top=-1
    return top flood region_data=list(input()) list(input()) region_data top=flood(region_data,flood_data) flood(region_data,flood_data) top total=sum(flood_data_final) sum(flood_data_final) total def flood2(region_data,flood_data):
    height = 0
    water_num=0
    top=0
    i=-1
    for data in region_data:
        i+=1
        if(data=="/"):
            if(height==0):
                top=i
            water_num+=height +0.5
            height+=1


        elif(data=="\\"):
            if(height>=2):
                water_num+=height-0.5
                height-=1
            elif(height==1):
                water_num+=0.5
                flood_data.append(water_num)
                water_num=0
                height=0


        elif(data=="_"):
            water_num+=height
    if(height==0):
        top=-1
    return top def flood2(region_data,flood_data):
    height = 0
    water_num=0
    top=0
    i=-1
    for data in region_data:
        i+=1
        if(data=="/"):
            if(height==0):
                top=i
            water_num+=height +0.5
            height+=1


        elif(data=="\\"):
            if(height>=2):
                water_num+=height-0.5
                height-=1
            elif(height==1):
                water_num+=0.5
                flood_data.append(water_num)
                water_num=0
                height=0


        elif(data=="_"):
            water_num+=height
    if(height==0):
        top=-1
    return top flood2 flood_data_final=flood_data + flood_data2 flood_data + flood_data2 flood_data_final
def flood(region_data,flood_data):
    height = 0
    water_num=0
    top=0
    i=-1
    for data in region_data:
        i+=1
        if(data=="\\"):
            if(height==0):
                top=i
            water_num+=height +0.5
            height+=1


        elif(data=="/"):
            if(height>=2):
                water_num+=height-0.5
                height-=1
            elif(height==1):
                water_num+=0.5
                flood_data.append(water_num)
                water_num=0
                height=0


        elif(data=="_"):
            water_num+=height
    if(height==0):
        top=-1
    return top







def flood2(region_data,flood_data):
    height = 0
    water_num=0
    top=0
    i=-1
    for data in region_data:
        i+=1
        if(data=="/"):
            if(height==0):
                top=i
            water_num+=height +0.5
            height+=1


        elif(data=="\\"):
            if(height>=2):
                water_num+=height-0.5
                height-=1
            elif(height==1):
                water_num+=0.5
                flood_data.append(water_num)
                water_num=0
                height=0


        elif(data=="_"):
            water_num+=height
    if(height==0):
        top=-1
    return top


region_data=list(input())
flood_data=[]
top=flood(region_data,flood_data)


if(top!=-1):
    region_data2=region_data[top:len(region_data)]
    region_data2.reverse()
    flood_data2=[]
    flood2(region_data2,flood_data2)
    flood_data2.reverse()
    flood_data_final=flood_data + flood_data2
else:
    flood_data_final=flood_data

flood_data_final=list(map(int,flood_data_final))
total=sum(flood_data_final)
num=[len(flood_data_final)]
flood_data_final=" ".join(list(map(str,num+flood_data_final)))

print(total)
print(f"{flood_data_final}")
