input = gets.chomp

s1 = []
s2 = [[0,0]]

input.chars.each_with_index do |c, i|
  case c
  when "\\"
    s1.push(i)
  when "/"
    tmp = s1.pop

    if !tmp
      next
    end

    a=[]
    a.push(s2.pop) while tmp < s2[-1][0]
    s2.push([tmp, i-tmp + a.inject(0){|sum, x| sum += x[-1]}])
  end
end

puts s2.drop(1).inject(0){|sum, s| sum + s[1]}, ([s2.drop(1).length] + s2.drop(1).map{|s| s[-1]}).join(" ")
