s = gets.chop.chars
s1 = []
s2 = []
s.each_with_index do |c, idx|
  case c
  when '\\'
    s1 << idx
  when '_'
  when '/'
    t = s1.pop
    next if t.nil?

    sum = idx - t
    loop do
      p = s2.pop
      break if p.nil?
      if p[0] > t
        sum += p[1]
      else
        s2 << p
        break
      end
    end
    s2 << [t, sum]
  end
end

puts s2.inject(0) { |acc, cur| acc + cur[1] }
puts [s2.length, *(s2.map{ |p| p[1] })].join(' ')
