str = gets
s1 = []
s2 = []
i = 0
total = 0

str.chars do |c|
  case c
  when '/' then
    if s1[-1]
      j = s1.pop
      s = i - j
      total += s
      while s2[-1] && s2[-1][0] > j
        s += s2.pop[1]
      end
      s2 << [j, s]
    end
  when '_' then
    # nop
  when '\\' then
    s1 << i
  end
  i += 1
end
puts total
if total == 0
  puts s2.length
else
  puts "#{s2.length} #{s2.map{|n| n[1]}*' '}"
end