s = gets.chomp.each_char.with_index.to_a
d, a, j = 0, 0, 0
as = []
s.each do |c, i|
  case c
  when ?_
    a += d
  when ?\\
    j = i if d == 0
    d += 1
    a += d - 0.5
  when ?/
    if d > 0
      a += d - 0.5
      d -= 1
      if d == 0
        as << [j, a.to_i]
        a = 0
      end
    end
  end
end
d, a = 0, 0
s.reverse.each do |c, i|
  case c
  when ?_
    a += d
  when ?/
    d += 1
    a += d - 0.5
  when ?\\
    if d > 0
      a += d - 0.5
      d -= 1
      if d == 0
        as << [i, a.to_i]
        a = 0
      end
    end
  end
end
as.uniq!(&:first)
as.sort_by!(&:first)
as.map!(&:last)
p as.inject(0, :+)
puts [as.size, *as].join ' '