$/+=<>;$_=(x x$=.<>)x2;s/ //g;$b[length$&]=/o*x{0,$\/}o*/while s/.//;print$#b