stack1 = []
stack2 = []

total_area = 0
cur_pos = 0

gets.chomp.each_char do |char|
  if char == '\\'
    stack1.push(cur_pos)
  elsif char == '/' && !stack1.empty?
    last_pos = stack1.pop
    total_area += cur_pos - last_pos
    sub_area = cur_pos - last_pos
    while !stack2.empty? && stack2.last[0] > last_pos
      sub_area += stack2.pop[1]
    end
    stack2.push([last_pos, sub_area])
  end

  cur_pos += 1
end

puts total_area
print stack2.size
print ' ' + stack2.map {|arr| arr[1] }.join(' ') unless stack2.empty?
puts