class Area
  def solve
    tsm = 0
    st = []
    ans = []

    s = gets.chomp
    (0...s.size).each do |i|
      if s[i] == "\\"
        st << i
      elsif s[i] == "/"
        unless st.empty?
          tsm += (i - st[-1])

          while (!ans.empty? && ans[-1][0] > st[-1])
            tsm += ans[-1][1]
            ans.pop
          end

          ans << [st.pop, tsm]
          tsm = 0
        end
      end
    end

    if ans.empty?
      puts 0
      puts 0
    else
      ans = ans.map{ |i| i[1] }
      puts ans.inject(:+)
      puts "#{ans.size} #{ans.join(" ")}"
    end

  end
end

if $0 == __FILE__
  Area.new.solve
end