s=[]
a=[]
gets.size.times{|i|c=$_[i]
if$*!=s&&c[?/]
x=s.pop
y=i-x
y+=a.pop[1]while a[-1]&&x<a[-1][0]
a.push [x,y]
end
s.push i if c[?\\]}
p(0,0)|exit if !A=a.transpose[1]
p A.reduce :+
puts [A.size,A]*" "