s = []
a = []

data = gets

data.size.times do |i|
  c = data[i]

  if s.any? && c == '/'
    x = s.pop
    y = i - x
    y += a.pop[1] while a.any? && x < a.last[0]
    a << [x, y]
  end

  s << i if c == '\\'
end

A = a.map { |e| e[1] }

unless A.any?
  print "0\n0\n"
  exit
end

printf "%d\n%d %s\n", A.reduce(:+), A.size, A.join(' ')